Skip to content

Colota - Android GPS Location tracker

fix: redundant bar above tab bar on Android 14 (#283)

Max Dietrich95763f8a9acc
diff --git a/apps/mobile/App.tsx b/apps/mobile/App.tsx
index a45514a0..068a08d5 100644
--- a/apps/mobile/App.tsx
+++ b/apps/mobile/App.tsx
@@ -5,8 +5,8 @@
import React, { useMemo, useState, useCallback } from "react"
import { NavigationContainer, NavigationContainerRef } from "@react-navigation/native"
import { createNativeStackNavigator } from "@react-navigation/native-stack"
-import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context"
-import { StatusBar, Platform, StyleSheet } from "react-native"
+import { SafeAreaProvider } from "react-native-safe-area-context"
+import { View, StatusBar, Platform, StyleSheet } from "react-native"
import MapLibreGL from "@maplibre/maplibre-react-native"
import { ThemeProvider, useTheme } from "./src/hooks/useTheme"
import { fonts } from "./src/styles/typography"
@@ -200,7 +200,7 @@ function AppNavigator() {
<SafeAreaProvider>
<StatusBar {...statusBarConfig} />
<NavigationContainer linking={linking} ref={navigationRef} onStateChange={handleStateChange}>
- <SafeAreaView style={styles.flex} edges={["left", "right", "bottom"]}>
+ <View style={styles.flex}>
<Stack.Navigator initialRouteName="Dashboard" screenOptions={screenOptions}>
{SCREEN_CONFIG.map((screen) => (
<Stack.Screen
@@ -215,7 +215,7 @@ function AppNavigator() {
))}
</Stack.Navigator>
<BottomTabBar currentRoute={currentRoute} onNavigate={handleTabNavigate} />
- </SafeAreaView>
+ </View>
</NavigationContainer>
</SafeAreaProvider>
)
diff --git a/apps/mobile/android/gradle.properties b/apps/mobile/android/gradle.properties
index 386ab56b..5c2ec379 100644
--- a/apps/mobile/android/gradle.properties
+++ b/apps/mobile/android/gradle.properties
@@ -46,5 +46,5 @@ reactNativeDevServerIp=localhost
# Use this property to enable edge-to-edge display support.
# This allows your app to draw behind system bars for an immersive UI.
# Note: Only works with ReactActivity and should not be used with custom Activity.
-edgeToEdgeEnabled=false
+edgeToEdgeEnabled=true
diff --git a/apps/mobile/src/components/ui/BottomTabBar.tsx b/apps/mobile/src/components/ui/BottomTabBar.tsx
index 0b1dee32..5affcd8b 100644
--- a/apps/mobile/src/components/ui/BottomTabBar.tsx
+++ b/apps/mobile/src/components/ui/BottomTabBar.tsx
@@ -4,6 +4,7 @@
*/
import React from "react"
import { View, Pressable, Text, StyleSheet } from "react-native"
+import { useSafeAreaInsets } from "react-native-safe-area-context"
import { Settings, LucideIcon, MapPinned, MapPinHouse, Route } from "lucide-react-native"
import { useTheme } from "../../hooks/useTheme"
import { fonts } from "../../styles/typography"
@@ -32,6 +33,7 @@ interface BottomTabBarProps {
export function BottomTabBar({ currentRoute, onNavigate }: BottomTabBarProps) {
const { colors } = useTheme()
+ const insets = useSafeAreaInsets()
if (!currentRoute || !TAB_ROUTES.has(currentRoute)) return null
@@ -40,8 +42,8 @@ export function BottomTabBar({ currentRoute, onNavigate }: BottomTabBarProps) {
style={[
styles.container,
{
- backgroundColor: colors.card,
- borderTopColor: colors.border
+ backgroundColor: colors.background,
+ paddingBottom: insets.bottom + 8
}
]}
>
@@ -68,9 +70,11 @@ export { TAB_ROUTES }
const styles = StyleSheet.create({
container: {
flexDirection: "row",
- borderTopWidth: 1,
paddingTop: 8,
- paddingBottom: 6
+ paddingBottom: 6,
+ elevation: 0,
+ shadowOpacity: 0,
+ shadowRadius: 0
},
tab: {
flex: 1,
diff --git a/apps/mobile/src/screens/GeofenceScreen.tsx b/apps/mobile/src/screens/GeofenceScreen.tsx
index d9770fb6..a7776d77 100644
--- a/apps/mobile/src/screens/GeofenceScreen.tsx
+++ b/apps/mobile/src/screens/GeofenceScreen.tsx
@@ -398,7 +398,7 @@ const styles = StyleSheet.create({
name: { fontSize: 15, ...fonts.semiBold, marginBottom: 2 },
radiusRow: { flexDirection: "row", alignItems: "center", gap: 4 },
radius: { fontSize: 12 },
- empty: { alignItems: "center", paddingVertical: 40 },
+ empty: { alignItems: "center", paddingVertical: 20 },
emptyText: { fontSize: 15, ...fonts.semiBold, marginBottom: 6 },
emptyHint: {
fontSize: 13,