11import { useCallback , useEffect , useRef , useState } from "react" ;
22import { BackHandler , Keyboard , Pressable , TextInput , View } from "react-native" ;
3- import { useSafeAreaInsets } from "react-native-safe-area-context " ;
3+ import { useMaterialToolbarLayout } from "./useMaterialToolbarLayout " ;
44import { NativeStackScreenOptions } from "../native/StackHeader" ;
55import { AndroidWorkspaceSidebarButton } from "../features/layout/workspace-sidebar-toolbar" ;
66import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider" ;
@@ -15,7 +15,7 @@ import { useAndroidControlSizing } from "./useAndroidControlSizing";
1515
1616export function ScreenHeader ( props : ScreenHeaderProps ) {
1717 const { search } = props ;
18- const insets = useSafeAreaInsets ( ) ;
18+ const { paddingTop , paddingBottom } = useMaterialToolbarLayout ( ) ;
1919 const { scale, buttonSize, iconSize, smallIconSize } = useAndroidControlSizing ( ) ;
2020 const { themeVariables } = useAppearancePreferences ( ) ;
2121 const inputRef = useRef < TextInput > ( null ) ;
@@ -85,8 +85,8 @@ export function ScreenHeader(props: ScreenHeaderProps) {
8585 < View
8686 className = "border-b border-header-border bg-header px-3"
8787 style = { {
88- paddingTop : Math . max ( insets . top , 12 * scale ) ,
89- paddingBottom : 10 * scale ,
88+ paddingTop,
89+ paddingBottom : 8.75 * scale ,
9090 borderBottomWidth : 0 ,
9191 } }
9292 >
@@ -111,10 +111,10 @@ export function ScreenHeader(props: ScreenHeaderProps) {
111111 < View
112112 className = "flex-1 flex-row items-center bg-input"
113113 style = { {
114- minHeight : Math . max ( 44 , 44 * scale ) ,
115- gap : 10 * scale ,
116- borderRadius : 16 * scale ,
117- paddingHorizontal : 14 * scale ,
114+ minHeight : Math . max ( 48 , 38.5 * scale ) ,
115+ gap : 8.75 * scale ,
116+ borderRadius : 14 * scale ,
117+ paddingHorizontal : 12.25 * scale ,
118118 } }
119119 >
120120 < SymbolView
@@ -135,7 +135,7 @@ export function ScreenHeader(props: ScreenHeaderProps) {
135135 }
136136 placeholderTextColorClassName = "accent-placeholder"
137137 className = "flex-1 text-base font-sans text-header-foreground"
138- style = { { paddingVertical : 8 * scale } }
138+ style = { { paddingVertical : 7 * scale } }
139139 />
140140 </ View >
141141 { menuView }
@@ -194,10 +194,7 @@ export function ScreenHeader(props: ScreenHeaderProps) {
194194 { header }
195195 </ View >
196196 { searching ? (
197- < View
198- className = "absolute inset-0 bg-header px-2"
199- style = { { paddingTop : Math . max ( insets . top , 12 * scale ) , paddingBottom : 8 * scale } }
200- >
197+ < View className = "absolute inset-0 bg-header px-2" style = { { paddingTop, paddingBottom } } >
201198 < View className = "flex-1 flex-row items-center gap-1" >
202199 < ScreenHeaderButton
203200 accessibilityLabel = { search . closeAccessibilityLabel ?? "Close search" }
0 commit comments