Skip to content

Colota - Android GPS Location tracker

removed not useful comments

Max Dietrich645666dcc1f3
diff --git a/android/app/src/main/java/com/locata/LocationServiceModule.kt b/android/app/src/main/java/com/locata/LocationServiceModule.kt
index 93c7ab89..b611325d 100644
--- a/android/app/src/main/java/com/locata/LocationServiceModule.kt
+++ b/android/app/src/main/java/com/locata/LocationServiceModule.kt
@@ -310,7 +310,7 @@ class LocationServiceModule(reactContext: ReactApplicationContext) :
// GEOFENCE OPERATIONS
// ==============================================================
- // Helper function to reduce duplication
+ // Helper function to trigger zone Rechecks
private fun triggerZoneRecheck() {
try {
startServiceWithAction(LocationForegroundService.ACTION_RECHECK_ZONE)
@@ -425,26 +425,6 @@ class LocationServiceModule(reactContext: ReactApplicationContext) :
}
}
- // ==============================================================
- // STATISTICS & ANALYTICS (Future)
- // ==============================================================
-
- // TODO: Add when implementing statistics feature
- // @ReactMethod
- // fun getLocationStats(timeRange: String, promise: Promise) = executeAsync(promise) {
- // // Implementation here
- // }
-
- // @ReactMethod
- // fun getDistanceTraveled(startTime: Long, endTime: Long, promise: Promise) = executeAsync(promise) {
- // // Implementation here
- // }
-
- // @ReactMethod
- // fun getSpeedAnalytics(promise: Promise) = executeAsync(promise) {
- // // Implementation here
- // }
-
// ==============================================================
// SETTINGS PERSISTENCE
// ==============================================================
@@ -505,7 +485,7 @@ class LocationServiceModule(reactContext: ReactApplicationContext) :
}
}
- // Add helper for all service intents
+ // helper for all service intents
private fun startServiceWithAction(action: String) {
try {
val intent = Intent(reactApplicationContext, LocationForegroundService::class.java).apply {
diff --git a/android/app/src/main/java/com/locata/LocationsUtils.kt b/android/app/src/main/java/com/locata/LocationsUtils.kt
index aaaef9c5..128dcab0 100644
--- a/android/app/src/main/java/com/locata/LocationsUtils.kt
+++ b/android/app/src/main/java/com/locata/LocationsUtils.kt
@@ -156,7 +156,6 @@ class LocationUtils(private val context: Context) {
Log.e(TAG, "Network error: ${e.message}", e)
false
} finally {
- // Manual cleanup since we can't use .use{}
connection?.disconnect()
}
}
diff --git a/src/components/features/dashboard/ComingSoonRibbon.tsx b/src/components/features/dashboard/ComingSoonRibbon.tsx
index a602b34a..480acaae 100644
--- a/src/components/features/dashboard/ComingSoonRibbon.tsx
+++ b/src/components/features/dashboard/ComingSoonRibbon.tsx
@@ -30,12 +30,12 @@ const styles = StyleSheet.create({
comingSoonRibbon: {
position: "absolute",
top: 8,
- right: -10, // push it a bit outside for the angled effect
+ right: -10,
paddingVertical: 2,
paddingHorizontal: 14,
transform: [{ rotate: "45deg" }],
zIndex: 10,
- elevation: 10, // Android shadow
+ elevation: 10,
shadowOffset: { width: 0, height: 1 },
shadowOpacity: 0.3,
shadowRadius: 2,
diff --git a/src/components/features/dashboard/CoordinateDisplay.tsx b/src/components/features/dashboard/CoordinateDisplay.tsx
index 9933290a..5e72b829 100644
--- a/src/components/features/dashboard/CoordinateDisplay.tsx
+++ b/src/components/features/dashboard/CoordinateDisplay.tsx
@@ -97,23 +97,19 @@ export function CoordinateDisplay({ coords }: Props) {
}
const styles = StyleSheet.create({
- /** Main container with vertical spacing between rows */
container: {
gap: 10,
},
- /** Horizontal row container for coordinate cards */
row: {
flexDirection: "row",
gap: 10,
},
- /** Individual coordinate card styling */
coordCard: {
flex: 1,
padding: 12,
borderRadius: 8,
borderWidth: 1,
},
- /** Label text style (uppercase, small, secondary color) */
coordLabel: {
fontSize: 10,
fontWeight: "600",
@@ -121,13 +117,11 @@ const styles = StyleSheet.create({
letterSpacing: 0.5,
textTransform: "uppercase",
},
- /** Main coordinate value text style */
coordValue: {
fontSize: 15,
fontWeight: "700",
letterSpacing: -0.3,
},
- /** Unit text style (smaller, semi-transparent) */
coordUnit: {
fontSize: 12,
fontWeight: "500",
diff --git a/src/components/features/dashboard/QuickAccess.tsx b/src/components/features/dashboard/QuickAccess.tsx
index be4b7cd2..d2b48104 100644
--- a/src/components/features/dashboard/QuickAccess.tsx
+++ b/src/components/features/dashboard/QuickAccess.tsx
@@ -20,7 +20,7 @@ interface NavItem {
color: string;
onPress?: () => void;
comingSoon?: boolean;
- subtitle?: string; // NEW: Add subtitle for context
+ subtitle?: string;
}
interface QuickAccessProps {
@@ -138,17 +138,16 @@ const styles = StyleSheet.create({
navGrid: {
flexDirection: "row",
flexWrap: "wrap",
- gap: 12, // Increased gap
+ gap: 12,
},
navItem: {
width: "31%",
- aspectRatio: 1, // Square cards
+ aspectRatio: 1,
padding: 12,
- borderRadius: 16, // More rounded
+ borderRadius: 16,
borderWidth: 1,
alignItems: "center",
justifyContent: "center",
- // Add subtle shadow
shadowColor: "#000",
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.05,
@@ -165,7 +164,7 @@ const styles = StyleSheet.create({
borderWidth: 1,
},
navIcon: {
- fontSize: 24, // Slightly larger
+ fontSize: 24,
},
navLabel: {
fontSize: 12,
diff --git a/src/components/features/databases/DatabaseStatistics.tsx b/src/components/features/databases/DatabaseStatistics.tsx
index d290a46a..087325bc 100644
--- a/src/components/features/databases/DatabaseStatistics.tsx
+++ b/src/components/features/databases/DatabaseStatistics.tsx
@@ -102,7 +102,6 @@ export function DatabaseStatistics({ stats }: DatabaseStatisticsProps) {
);
}
-// --- Styles ---
const styles = StyleSheet.create({
metricsSection: {
marginBottom: 24,
diff --git a/src/components/features/settings/PermissionsDashboard.tsx b/src/components/features/settings/PermissionsDashboard.tsx
index 14ab7e98..0651d53a 100644
--- a/src/components/features/settings/PermissionsDashboard.tsx
+++ b/src/components/features/settings/PermissionsDashboard.tsx
@@ -13,8 +13,6 @@ import {
import { useTheme } from "../../../hooks/useTheme";
import { Container, Button } from "../..";
-// ✅ FIXED: Moved outside to avoid "unstable-nested-components"
-// Passed colors as a prop to keep it functional and clean
type RowProps = {
label: string;
isGranted: boolean;
@@ -110,7 +108,7 @@ const styles = StyleSheet.create({
row: {
flexDirection: "row",
justifyContent: "space-between",
- paddingVertical: 12, // Increased for better tap target
+ paddingVertical: 12,
borderBottomWidth: StyleSheet.hairlineWidth,
},
label: { fontSize: 14 },
diff --git a/src/components/features/settings/ServerConnection.tsx b/src/components/features/settings/ServerConnection.tsx
index 453b41f7..edb18760 100644
--- a/src/components/features/settings/ServerConnection.tsx
+++ b/src/components/features/settings/ServerConnection.tsx
@@ -123,7 +123,7 @@ export function ServerConnection({
description: "Configure an endpoint in settings to start syncing data.",
},
offline: {
- color: colors.textSecondary, // Neutralere Farbe für Offline
+ color: colors.textSecondary,
label: "Offline Mode",
description: "Syncing is paused. Data is only collected locally.",
},
diff --git a/src/components/ui/Button.tsx b/src/components/ui/Button.tsx
index c50b719b..c8a1a831 100644
--- a/src/components/ui/Button.tsx
+++ b/src/components/ui/Button.tsx
@@ -14,17 +14,10 @@ import {
} from "react-native";
import { useTheme } from "../../hooks/useTheme";
-/**
- * Props for the Button component
- */
type Props = {
- /** Text to display inside the button */
title: string;
- /** Function to call when button is pressed */
onPress: (event: GestureResponderEvent) => void;
- /** Disable button interaction (default: false) */
disabled?: boolean;
- /** Additional styles for the button container */
style?: StyleProp<ViewStyle>;
activeOpacity?: number;
color?: string;
@@ -78,14 +71,12 @@ export function Button({
}
const styles = StyleSheet.create({
- /** Button container base styles */
button: {
paddingVertical: 12,
paddingHorizontal: 24,
alignItems: "center",
marginVertical: 8,
},
- /** Button text styles */
text: {
fontSize: 16,
fontWeight: "600",
diff --git a/src/components/ui/Card.tsx b/src/components/ui/Card.tsx
index b494bc1a..a26b849b 100644
--- a/src/components/ui/Card.tsx
+++ b/src/components/ui/Card.tsx
@@ -2,6 +2,7 @@
* Copyright (C) 2026 Max Dietrich
* Licensed under the GNU AGPLv3. See LICENSE in the project root for details.
*/
+
import React from "react";
import { View, StyleSheet, ViewStyle, StyleProp } from "react-native";
import { useTheme } from "../../hooks/useTheme";
diff --git a/src/components/ui/CollapsibleSection.tsx b/src/components/ui/CollapsibleSection.tsx
index 8fd99ab1..77d4bda6 100644
--- a/src/components/ui/CollapsibleSection.tsx
+++ b/src/components/ui/CollapsibleSection.tsx
@@ -14,7 +14,6 @@ import {
} from "react-native";
import { useTheme } from "../../hooks/useTheme";
-// Enable LayoutAnimation for Android
if (
Platform.OS === "android" &&
UIManager.setLayoutAnimationEnabledExperimental
@@ -37,7 +36,6 @@ export function CollapsibleSection({
const { colors } = useTheme();
const toggle = () => {
- // This creates the smooth "slide" effect when opening
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
setIsOpen(!isOpen);
};
diff --git a/src/components/ui/Divider.tsx b/src/components/ui/Divider.tsx
index d3caf37a..135e2e73 100644
--- a/src/components/ui/Divider.tsx
+++ b/src/components/ui/Divider.tsx
@@ -7,7 +7,6 @@ import { View, StyleSheet } from "react-native";
import { useTheme } from "../../hooks/useTheme";
export const Divider = () => {
- // Hook must be called inside the function body
const { colors } = useTheme();
return <View style={[styles.divider, { backgroundColor: colors.divider }]} />;
diff --git a/src/components/ui/Footer.tsx b/src/components/ui/Footer.tsx
index 8d041e4c..b09ca44d 100644
--- a/src/components/ui/Footer.tsx
+++ b/src/components/ui/Footer.tsx
@@ -1,4 +1,3 @@
-// src/components/Footer.tsx
/**
* Copyright (C) 2026 Max Dietrich
* Licensed under the GNU AGPLv3. See LICENSE in the project root for details.
diff --git a/src/contexts/TrackingProvider.tsx b/src/contexts/TrackingProvider.tsx
index 92d1e627..b8799b23 100644
--- a/src/contexts/TrackingProvider.tsx
+++ b/src/contexts/TrackingProvider.tsx
@@ -37,7 +37,7 @@ const TrackingContext = createContext<TrackingContextType | null>(null);
function parseRawSettings(allRaw: Record<string, string>): Settings {
return {
...DEFAULT_SETTINGS,
- // Convert Android milliseconds back to JS-friendly seconds
+ // Convert Android milliseconds back to seconds (UNIX-Timestamp)
interval: allRaw.interval
? parseInt(allRaw.interval, 10) / 1000
: DEFAULT_SETTINGS.interval,
@@ -135,7 +135,6 @@ export function TrackingProvider({ children }: { children: React.ReactNode }) {
* are parsed into their respective JS types (Numbers, Booleans, and JSON objects).
*/
useEffect(() => {
- // Only run initialization once
if (hasInitializedRef.current) return;
const init = async () => {
@@ -185,7 +184,7 @@ export function TrackingProvider({ children }: { children: React.ReactNode }) {
return () => {
isMountedRef.current = false;
};
- }, [internalStart, setSettings]); // Include dependencies as required by ESLint
+ }, [internalStart, setSettings]);
/**
* Wrapped tracking controls with useCallback for stable references
diff --git a/src/screens/AboutScreen.tsx b/src/screens/AboutScreen.tsx
index 6085bfeb..8c42d35e 100644
--- a/src/screens/AboutScreen.tsx
+++ b/src/screens/AboutScreen.tsx
@@ -77,7 +77,6 @@ const LinkButton = ({
</TouchableOpacity>
);
-// Moved outside of AboutScreen component
const TechRow = ({
label,
value,
@@ -124,7 +123,7 @@ export function AboutScreen({}: ScreenProps) {
const newCount = tapCount + 1;
setTapCount(newCount);
- // Enable debug mode after 7 taps (like Android's Developer Options)
+ // Enable debug mode after 7 taps
if (newCount >= 7) {
setShowDebugInfo(true);
setTapCount(0);
diff --git a/src/screens/DataManagementScreen.tsx b/src/screens/DataManagementScreen.tsx
index 1c6126cc..0b05c400 100644
--- a/src/screens/DataManagementScreen.tsx
+++ b/src/screens/DataManagementScreen.tsx
@@ -380,7 +380,6 @@ const ActionRow = ({
</TouchableOpacity>
);
-// --- Styles ---
const styles = StyleSheet.create({
keyboardAvoid: {
flex: 1,
diff --git a/src/screens/ExportDataScreen.tsx b/src/screens/ExportDataScreen.tsx
index 1081d566..84732604 100644
--- a/src/screens/ExportDataScreen.tsx
+++ b/src/screens/ExportDataScreen.tsx
@@ -95,7 +95,7 @@ export function ExportDataScreen() {
const maxSize = Math.max(...sizesArray);
const minBytes = data.length * minSize; // CSV
- const maxBytes = data.length * maxSize; // GPX
+ const maxBytes = data.length * maxSize; // kml
const estimatedSize = `${formatBytes(minBytes)} - ${formatBytes(
maxBytes
)}`;
@@ -620,13 +620,11 @@ const convertToKML = (data: LocationCoords[]): string => {
return kml;
};
-// --- Styles ---
const styles = StyleSheet.create({
scrollContent: {
paddingBottom: 40,
},
- // Header
header: {
marginTop: 20,
marginBottom: 20,
@@ -637,8 +635,6 @@ const styles = StyleSheet.create({
fontWeight: "700",
letterSpacing: -0.5,
},
-
- // Stats Container - Matching StatsCard style
statsContainer: {
borderRadius: 16,
borderWidth: 2,
@@ -672,14 +668,10 @@ const styles = StyleSheet.create({
marginHorizontal: 12,
opacity: 0.3,
},
-
- // Section
section: {
paddingHorizontal: 20,
marginBottom: 24,
},
-
- // Format Option - Matching PresetOption style
formatOption: {
paddingVertical: 8,
paddingHorizontal: 0,
@@ -752,8 +744,6 @@ const styles = StyleSheet.create({
height: 12,
borderRadius: 6,
},
-
- // Export Button
exportSection: {
paddingHorizontal: 20,
},
@@ -787,13 +777,9 @@ const styles = StyleSheet.create({
color: "#fff",
opacity: 0.9,
},
-
- // Disabled State
disabledButton: {
opacity: 0.5,
},
-
- // Loader
loader: {
...StyleSheet.absoluteFillObject,
zIndex: 999,
diff --git a/src/screens/SettingsScreen.tsx b/src/screens/SettingsScreen.tsx
index 2398cfdc..17fc9c05 100644
--- a/src/screens/SettingsScreen.tsx
+++ b/src/screens/SettingsScreen.tsx
@@ -891,8 +891,6 @@ const styles = StyleSheet.create({
paddingTop: 16,
paddingBottom: 40,
},
-
- // Header
header: {
marginBottom: 20,
},
@@ -901,8 +899,6 @@ const styles = StyleSheet.create({
fontWeight: "700",
letterSpacing: -0.5,
},
-
- // Setting Rows
settingRow: {
flexDirection: "row",
justifyContent: "space-between",
@@ -922,8 +918,6 @@ const styles = StyleSheet.create({
fontSize: 13,
lineHeight: 18,
},
-
- // Inputs
inputGroup: {
marginBottom: 12,
},
@@ -952,8 +946,6 @@ const styles = StyleSheet.create({
borderRadius: 12,
fontSize: 15,
},
-
- // Buttons
testButton: {
padding: 16,
borderRadius: 12,
@@ -963,8 +955,6 @@ const styles = StyleSheet.create({
disabledButton: {
opacity: 0.5,
},
-
- // Response
responseBox: {
marginTop: 12,
padding: 14,
@@ -976,16 +966,12 @@ const styles = StyleSheet.create({
fontSize: 14,
fontWeight: "600",
},
-
- // Presets
presetsContainer: {
marginBottom: 16,
},
presetSpacer: {
height: 8,
},
-
- // Advanced Toggle
advancedToggle: {
paddingVertical: 14,
paddingHorizontal: 16,
@@ -995,7 +981,7 @@ const styles = StyleSheet.create({
marginTop: 8,
},
advancedToggleActive: {
- backgroundColor: "transparent", // Will be overridden by dynamic color
+ backgroundColor: "transparent",
},
advancedToggleInactive: {
backgroundColor: "transparent",
@@ -1004,8 +990,6 @@ const styles = StyleSheet.create({
fontSize: 15,
fontWeight: "600",
},
-
- // Advanced Panel
advancedPanel: {
marginTop: 16,
},
@@ -1019,8 +1003,6 @@ const styles = StyleSheet.create({
fontSize: 13,
fontWeight: "500",
},
-
- // Parameter Groups
paramGroup: {
marginBottom: 4,
},
@@ -1032,8 +1014,6 @@ const styles = StyleSheet.create({
marginBottom: 16,
opacity: 0.6,
},
-
- // Setting Blocks
settingBlock: {
marginBottom: 20,
},
@@ -1047,8 +1027,6 @@ const styles = StyleSheet.create({
marginBottom: 12,
lineHeight: 18,
},
-
- // Grid Options
optionsGrid: {
flexDirection: "row",
gap: 8,
@@ -1066,8 +1044,6 @@ const styles = StyleSheet.create({
fontSize: 14,
fontWeight: "600",
},
-
- // Retry Grid
retryGrid: {
flexDirection: "row",
gap: 10,
@@ -1086,16 +1062,12 @@ const styles = StyleSheet.create({
retryHint: {
marginTop: 8,
},
-
- // Nested Settings
nestedSetting: {
marginTop: 12,
paddingLeft: 16,
borderLeftWidth: 3,
borderLeftColor: "rgba(0,0,0,0.1)",
},
-
- // Links
linkRow: {
flexDirection: "row",
justifyContent: "space-between",
diff --git a/src/styles/colors.ts b/src/styles/colors.ts
index e64b1b77..3034ffe6 100644
--- a/src/styles/colors.ts
+++ b/src/styles/colors.ts
@@ -10,7 +10,7 @@ export const lightColors: ThemeColors = {
primary: "#7986CB",
primaryDark: "#1A237E",
primaryLight: "#C5CAE9",
- secondary: "#FF7043", // Warm orange for secondary actions
+ secondary: "#FF7043",
secondaryDark: "#E64A19",
secondaryLight: "#FFCCBC",
@@ -21,9 +21,9 @@ export const lightColors: ThemeColors = {
warning: "#FF9800",
warningDark: "#F57C00",
warningLight: "#FFE0B2",
- error: "#D32F2F", // ✅ Fixed: Strong, assertive red
+ error: "#D32F2F",
errorDark: "#B71C1C",
- errorLight: "#FFCDD2", // ✅ Fixed: Now actually lighter than base
+ errorLight: "#FFCDD2",
info: "#1976D2",
infoDark: "#0D47A1",
infoLight: "#BBDEFB",
@@ -48,8 +48,8 @@ export const lightColors: ThemeColors = {
// Interactive
placeholder: "#9AA0A6",
- link: "#5C6BC0", // ✅ Fixed: Slightly lighter than primary for better hierarchy
- linkVisited: "#7986CB", // ✅ Fixed: Visited links are now lighter (standard convention)
+ link: "#5C6BC0",
+ linkVisited: "#7986CB",
overlay: "rgba(0, 0, 0, 0.5)",
shadow: "rgba(0, 0, 0, 0.1)",
@@ -71,10 +71,10 @@ export const darkColors: ThemeColors = {
success: "#4CAF50",
successDark: "#388E3C",
successLight: "#C8E6C9",
- warning: "#FF9800", // ✅ Fixed: Consistent with light mode
+ warning: "#FF9800",
warningDark: "#F57C00",
warningLight: "#FFE0B2",
- error: "#EF5350", // ✅ Fixed: Brighter red for dark backgrounds
+ error: "#EF5350",
errorDark: "#D32F2F",
errorLight: "#FFCDD2",
info: "#4285F4",
@@ -101,8 +101,8 @@ export const darkColors: ThemeColors = {
// Interactive
placeholder: "#AAAAAA",
- link: "#9FA8DA", // ✅ Fixed: Lighter indigo for better visibility on dark
- linkVisited: "#7986CB", // ✅ Fixed: Visited links are now darker (standard convention)
+ link: "#9FA8DA",
+ linkVisited: "#7986CB",
overlay: "rgba(0, 0, 0, 0.7)",
shadow: "rgba(0, 0, 0, 0.3)",
diff --git a/src/types/global.ts b/src/types/global.ts
index 909c6543..05c6201a 100644
--- a/src/types/global.ts
+++ b/src/types/global.ts
@@ -3,10 +3,6 @@
* Licensed under the GNU AGPLv3. See LICENSE in the project root for details.
*/
-/**
- * Core type definitions for Colota location tracking app
- */
-
// ============================================================================
// NAVIGATION & UI
// ============================================================================