File tree Expand file tree Collapse file tree
apps/mobile/src/features/home Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { useWorkspaceState } from "../../state/workspace";
1212import { FabScrollContext } from "./FabScrollContext" ;
1313import { updateFabScroll } from "./fab-scroll" ;
1414import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider" ;
15+ import { ANDROID_HOME_FAB_MARGIN , androidHomeFabBottom } from "./android-home-fab-position" ;
1516
1617export function AndroidHomeFabLayout ( props : ComponentProps < typeof SharedAndroidHomeFabLayout > ) {
1718 const insets = useSafeAreaInsets ( ) ;
@@ -42,11 +43,10 @@ export function AndroidHomeFabLayout(props: ComponentProps<typeof SharedAndroidH
4243 extended
4344 expanded = { expanded }
4445 onPress = { props . onStartNewTask }
45- className = "absolute right-5 "
46+ className = "absolute"
4647 style = { {
47- bottom : props . sidebar
48- ? Math . max ( insets . bottom , 12 ) + 6
49- : Math . max ( insets . bottom , 16 ) + 16 ,
48+ right : ANDROID_HOME_FAB_MARGIN ,
49+ bottom : androidHomeFabBottom ( insets . bottom , props . sidebar ) ,
5050 } }
5151 />
5252 ) : null }
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import { WorkspaceConnectionTitle } from "./WorkspaceConnectionTitle";
2222import { useWorkspaceState } from "../../state/workspace" ;
2323import { useAndroidControlSizing } from "../../components/ui/useAndroidControlSizing" ;
2424import { useToolbarLayout } from "../../components/ui/useToolbarLayout" ;
25+ import { ANDROID_HOME_FAB_MARGIN , androidHomeFabBottom } from "./android-home-fab-position" ;
2526
2627/** One toolbar height for the compact list and expanded sidebar, including search. */
2728export function ThreadListToolbar ( props : {
@@ -140,12 +141,10 @@ export function ThreadListToolbar(props: {
140141 </ View >
141142 { state . hasConnections ? (
142143 < View
143- className = "absolute right-5 z-[5]"
144+ className = "absolute z-[5]"
144145 style = { {
145- bottom :
146- ( props . sidebar ? Math . max ( insets . bottom , 12 ) + 6 : Math . max ( insets . bottom , 16 ) + 16 ) +
147- fabSize +
148- 8 ,
146+ right : ANDROID_HOME_FAB_MARGIN ,
147+ bottom : androidHomeFabBottom ( insets . bottom , props . sidebar ) + fabSize + 8 ,
149148 } }
150149 >
151150 < AndroidAnchoredMenu actions = { props . filterActions } onPressAction = { props . onFilterAction } >
Original file line number Diff line number Diff line change 1+ // Material's FAB margin, in dp so it does not grow with the app's text size.
2+ export const ANDROID_HOME_FAB_MARGIN = 16 ;
3+
4+ /** Bottom offset shared by the New thread FAB and the filter button stacked above it. */
5+ export function androidHomeFabBottom ( safeAreaBottom : number , sidebar : boolean | undefined ) {
6+ return sidebar ? Math . max ( safeAreaBottom , 12 ) + 6 : safeAreaBottom + ANDROID_HOME_FAB_MARGIN ;
7+ }
You can’t perform that action at this time.
0 commit comments