Profile and settings branch - #18
Merged
Merged
Conversation
This commit significantly expands the GPS connectivity options by introducing support for Bluetooth Classic (SPP) alongside the existing WiFi (ESP32) and internal phone GPS providers. It also adds a testing mode for simulator redirection and implements GPS refresh rate controls.
**Key Changes:**
* **`GpsManager.kt`:**
* Refactored to handle multiple `GpsProvider` types: `WIFI`, `BLUETOOTH`, and `PHONE_GPS`.
* Implemented logic to switch between providers, ensuring only the selected source is active.
* Added support for sending commands (like rate changes) to the active commandable provider.
* Introduced `confirmedRateHz` to track hardware-confirmed refresh rates.
* **`MainActivity.kt`:**
* Initialized `BluetoothClassicClient` and implemented Bluetooth permission handling.
* Added persistent storage for GPS source, preferred refresh rate, and selected Bluetooth device using `SharedPreferences`.
* Implemented a "Test Simulator" redirect for WiFi connections, allowing the app to connect to a custom IP address for development/testing.
* **`SettingsScreen.kt`:**
* Revamped the "Hardware & Sensors" section with new UI for selecting GPS sources.
* Added a Bluetooth device picker (dropdown) for paired devices.
* Added a "Test Simulator" toggle and IP address field for WiFi configuration.
* Introduced a GPS rate selector (5Hz to 25Hz) with a "confirmed" status indicator.
* **`ESPTcpClient.kt`:**
* Implemented `CommandableGpsProvider` to support sending data to the ESP32.
* Added `updateTarget` to allow runtime redirection of the TCP connection without app restarts.
* Updated JSON processing to handle rate acknowledgments (`RATE_OK`) and errors from the firmware.
* **`ESPConnectionTestScreen.kt`:**
* Updated the UI to display the current GPS source (WiFi, Bluetooth, or Phone).
* Added display for the confirmed refresh rate and the name of the paired Bluetooth device.
* **Models & Data:**
* **`RawGPSData.kt`:** Added an optional `valid` boolean field.
* **`ESPDatabase.kt`:** Bumped database version to `4`.
* **`AndroidManifest.xml`:** Added necessary permissions for Bluetooth and `BLUETOOTH_CONNECT`.
* **`BluetoothClassicClient.kt` (New - implied by manager changes):**
* Introduced to handle SPP communication with external Bluetooth GPS modules.
This commit implements a major refactor of the application's color palette, moving from multiple section-specific accents (`accentCyan`, `accentBlue`, `accentAmber`) to a unified `accent` and `accentMuted` system. The new theme is built on a specific 5-color palette, improving visual hierarchy and reducing UI noise across all screens.
**Key Changes:**
* **`TrackProColors.kt` & `TrackProTheme.kt`:**
* Removed `accentCyan`, `accentBlue`, and `accentAmber`.
* Introduced `accent` (Yellow `#FEEA00` in dark mode), `onAccent` for high-contrast foregrounds, and `accentMuted` (Teal `#3C7A89`) for structural elements.
* Updated `DarkTrackProColors` and `LightTrackProColors` with the new interpolated color ramp.
* Mapped Material 3 color slots (`primary`, `secondary`, `tertiary`) to the single unified accent.
* **Global UI Components:**
* Updated `AppTopBar`, `CircularProgressIndicator`, `PrimaryButton`, and `CustomTextField` across all screens to use the unified `accent`.
* Refined `AppCard` styling to use subtler border and background treatments for achieved states.
* **Screens (`TrackScreen.kt`, `DragScreen.kt`, `TimeAttackScreen.kt`, etc.):**
* Replaced section-specific colors with `accent` or `accentMuted`.
* Standardized "View" buttons and loading indicators to use the primary accent.
* Updated `StatCell` to rely more on standard text colors rather than bright accents for better readability.
* **Settings & Connectivity:**
* Updated `SettingsScreen.kt` to use `textMuted` for toggle values, reserving color for functional warnings (e.g., GPS rate mismatches).
* Updated `ESPConnectionTestScreen.kt` to use `deltaGood` for "Live" status and primary accent for data streams.
* **Data Visualization (`LapDetailScreen.kt`):**
* Sourced `PRIMARY_COLOR` and `COMPARE_COLOR` for map traces from `DataVizColors` to ensure consistency with charts while maintaining distinct hues for overlaid data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.