Skip to content

Colota - Android GPS Location tracker

fix: clarify heartbeat and pause sub-options depend on "Don't record in zone"

Max Dietrichfbcea237c051
diff --git a/apps/docs/docs/guides/geofencing.md b/apps/docs/docs/guides/geofencing.md
index 9ac6a3df..7ae88b79 100644
--- a/apps/docs/docs/guides/geofencing.md
+++ b/apps/docs/docs/guides/geofencing.md
@@ -31,6 +31,8 @@ Each geofence has independent pause settings, configured in the editor (tap **
Locations are not saved or synced while inside the zone. GPS continues running to detect when you leave. This is the default behavior.
+This is also the master switch for the other pause options below. WiFi pause, motionless pause and the stationary heartbeat only take effect when this is on.
+
### Pause when on WiFi or Ethernet
Stops GPS entirely when connected to an unmetered network (home WiFi, Ethernet). GPS resumes automatically when the connection is lost. Useful if you want to completely stop GPS while at home on WiFi, saving additional battery.
diff --git a/apps/mobile/src/screens/GeofenceEditorScreen.tsx b/apps/mobile/src/screens/GeofenceEditorScreen.tsx
index ab265a31..7f40df91 100644
--- a/apps/mobile/src/screens/GeofenceEditorScreen.tsx
+++ b/apps/mobile/src/screens/GeofenceEditorScreen.tsx
@@ -267,27 +267,37 @@ export function GeofenceEditorScreen({ navigation, route }: any) {
/>
</SettingRow>
- <SettingRow label="WiFi/Ethernet pause" hint="Stop GPS on unmetered networks" style={styles.toggleRow}>
+ <SettingRow
+ label="WiFi/Ethernet pause"
+ hint="Stop GPS on unmetered networks"
+ style={[styles.toggleRow, !pauseTracking && styles.disabledRow]}
+ >
<Switch
testID="pause-wifi-toggle"
value={pauseOnWifi}
onValueChange={setPauseOnWifi}
+ disabled={!pauseTracking}
trackColor={{ false: colors.border, true: colors.primary + "80" }}
thumbColor={pauseOnWifi ? colors.primary : colors.border}
/>
</SettingRow>
- <SettingRow label="Motionless pause" hint="Stop GPS after no motion for a set time" style={styles.toggleRow}>
+ <SettingRow
+ label="Motionless pause"
+ hint="Stop GPS after no motion for a set time"
+ style={[styles.toggleRow, !pauseTracking && styles.disabledRow]}
+ >
<Switch
testID="pause-motionless-toggle"
value={pauseOnMotionless}
onValueChange={setPauseOnMotionless}
+ disabled={!pauseTracking}
trackColor={{ false: colors.border, true: colors.primary + "80" }}
thumbColor={pauseOnMotionless ? colors.primary : colors.border}
/>
</SettingRow>
- {pauseOnMotionless && (
+ {pauseTracking && pauseOnMotionless && (
<View style={[styles.nestedSetting, { borderLeftColor: colors.border }]}>
<SettingRow label="Timeout (min)" hint="Minutes without motion before GPS stops">
<TextInput
@@ -303,17 +313,22 @@ export function GeofenceEditorScreen({ navigation, route }: any) {
</View>
)}
- <SettingRow label="Stationary heartbeat" hint="Periodic server update while paused" style={styles.toggleRow}>
+ <SettingRow
+ label="Stationary heartbeat"
+ hint="Periodic server update while paused"
+ style={[styles.toggleRow, !pauseTracking && styles.disabledRow]}
+ >
<Switch
testID="heartbeat-toggle"
value={heartbeatEnabled}
onValueChange={setHeartbeatEnabled}
+ disabled={!pauseTracking}
trackColor={{ false: colors.border, true: colors.primary + "80" }}
thumbColor={heartbeatEnabled ? colors.primary : colors.border}
/>
</SettingRow>
- {heartbeatEnabled && (
+ {pauseTracking && heartbeatEnabled && (
<View style={[styles.nestedSetting, { borderLeftColor: colors.border }]}>
<SettingRow label="Interval (min)" hint="How often to send a location update">
<TextInput
@@ -329,7 +344,7 @@ export function GeofenceEditorScreen({ navigation, route }: any) {
</View>
)}
- {pauseOnWifi && pauseOnMotionless && (
+ {pauseTracking && pauseOnWifi && pauseOnMotionless && (
<View style={[styles.combinedNote, { borderTopColor: colors.border }]}>
<Text style={[styles.combinedNoteText, { color: colors.textSecondary }]}>
GPS resumes only when both WiFi is disconnected and motion is detected
@@ -362,6 +377,7 @@ const styles = StyleSheet.create({
nameInput: { flex: 1 },
numInput: { width: 80, textAlign: "center" },
toggleRow: { paddingVertical: 10 },
+ disabledRow: { opacity: 0.45 },
nestedSetting: { marginLeft: 16, paddingLeft: 12, borderLeftWidth: 3, marginTop: 4, marginBottom: 4 },
combinedNote: {
marginTop: 8,