From e47548d1ac36873f967263e9bebc0fcc7344102f Mon Sep 17 00:00:00 2001 From: tapframe Date: Sun, 4 May 2025 03:18:25 +0530 Subject: [PATCH] Enhance HomeScreen status bar configuration and layout adjustments This update improves the HomeScreen component by refining the status bar settings for better visual consistency across platforms. Key changes include ensuring the status bar is fully transparent, adjusting padding for iOS, and modifying the layout from SafeAreaView to View for better compatibility. Additionally, cleanup logic for the status bar has been optimized for Android, enhancing the overall user experience and maintainability of the code. --- src/screens/HomeScreen.tsx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 1916758..1b82a1e 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -425,25 +425,32 @@ const HomeScreen = () => { useFocusEffect( useCallback(() => { const statusBarConfig = () => { + // Ensure status bar is fully transparent and doesn't take up space StatusBar.setBarStyle("light-content"); StatusBar.setTranslucent(true); StatusBar.setBackgroundColor('transparent'); + + // For iOS specifically + if (Platform.OS === 'ios') { + StatusBar.setHidden(false); + } }; statusBarConfig(); return () => { - // Don't change StatusBar settings when unfocusing to prevent layout shifts - // Only set these when component unmounts completely + // Keep translucent when unfocusing to prevent layout shifts }; }, []) ); useEffect(() => { - // Only run cleanup when component unmounts completely, not on unfocus + // Only run cleanup when component unmounts completely return () => { - StatusBar.setTranslucent(false); - StatusBar.setBackgroundColor(currentTheme.colors.darkBackground); + if (Platform.OS === 'android') { + StatusBar.setTranslucent(false); + StatusBar.setBackgroundColor(currentTheme.colors.darkBackground); + } }; }, [currentTheme.colors.darkBackground]); @@ -553,7 +560,7 @@ const HomeScreen = () => { } return ( - + { } contentContainerStyle={[ styles.scrollContent, - { paddingTop: Platform.OS === 'ios' ? 39 : 90 } + { paddingTop: Platform.OS === 'ios' ? 100 : 90 } ]} showsVerticalScrollIndicator={false} > @@ -617,7 +624,7 @@ const HomeScreen = () => { ) )} - + ); };