drag_statistics_rework#15
Merged
Merged
Conversation
This commit introduces a continuous integration (CI) pipeline using GitHub Actions to automate the build and testing process for the `main` and `develop` branches.
**Key Changes:**
* **`.github/workflows/ci.yml`:**
* Created a new workflow named "TrackPro CI Pipeline".
* Configured the pipeline to trigger on pushes and pull requests to `main` and `develop`.
* Defined the `build-and-test` job running on `ubuntu-latest`.
* Added steps to:
* Checkout the repository code.
* Set up JDK 17 (Zulu distribution).
* Implement Gradle caching for improved build performance.
* Grant execution permissions to the `gradlew` wrapper.
* Run local unit tests via `./gradlew testDebugUnitTest`.
* Assemble the debug APK to verify build integrity.
# Conflicts: # .github/workflows/ci.yml
This commit centralizes common utility functions for GPS distance calculations, date/time formatting, and lap time conversions. It also removes legacy code and improves the consistency of timestamp handling across the application.
**Key Changes:**
* **New Utility Classes:**
* **`DateFormatterUtil.kt`:** Centralized `SimpleDateFormat` instances for consistent date, time, and log timestamp formatting.
* **`GpsUtils.kt`:** Extracted `haversineDistance` into a standalone top-level function.
* **`TimeUtils.kt`:** Moved lap time conversion extensions (`toLapTimeMillis` and `toLapTimeString`) to a shared utility file.
* **`DragTimeCalculation.kt`:**
* Removed the legacy `timeFromZeroToHundred` post-session analysis function.
* Removed the private `haversineDistance` implementation in favor of the shared utility.
* **`UnixTimestamp.kt`:**
* Updated to use `DateFormatterUtil` for log timestamp parsing.
* Refactored `convertToUnixTimestamp` to use `Calendar` constants properly, avoiding deprecated `Date` property accessors.
* **`PostProcessing.kt`:**
* Replaced the local `haversine` implementation with the shared `haversineDistance` utility.
* **UI Components (`TimeAttackListItem.kt`, `DragTimesList.kt`, `LapDetailScreen.kt`):**
* Updated to use `DateFormatterUtil` for displaying session dates and times.
* Removed redundant local implementations of lap time conversion helpers.
* **Project Structure:**
* Moved `UnixTimestamp.kt` into the `com.example.trackpro.managerClasses.calculationClasses` package.
…nd modernize the chart display.
**Key Changes:**
* **Logic & Metrics:**
* Implemented `haversineMeters` to calculate precise distance between GPS coordinates.
* Added new session metrics: Max Speed, Average Speed, Max Acceleration, and Elevation (Net, Gain, and Loss).
* Updated the duration calculation and distance formatting (switching between meters and kilometers).
* **UI Enhancements:**
* Replaced the multi-page `HorizontalPager` with a unified single-page layout.
* Removed the Map view to focus on performance metrics and telemetry data.
* Redesigned the stats panel into a more compact grid using `CompactStat` and `DragMetricCard` components.
* Simplified the "Session Overview" header and divider styling.
* **Chart Improvements:**
* Updated `LineChart` to support toggling the X-axis between **Distance (Meters)** and **Time (Seconds)**.
* Enhanced chart styling with a cleaner background, specific axis colors, and a translucent red fill for the speed trace.
* Added a value formatter to the X-axis for clearer unit display (`m` or `s`).
* **Code Cleanup:**
* Removed unused imports related to MapLibre, Pager, and lifecycle observers.
* Adjusted font sizes and paddings across the screen for better information density.
…lication
This commit introduces a new centralized `TrackProTheme` using `CompositionLocalProvider` and refactors all screens to consume colors from this theme instead of a static object. It also introduces a `LightTrackProColors` scheme and refines existing color values for better visual consistency.
**Key Changes:**
* **Theme & Styling:**
* **`TrackProTheme.kt`:** Created a new theme wrapper in `extrasForUI` that provides a `TrackProColorScheme` via `LocalTrackProColors`.
* **`TrackProColors.kt`:** Redefined `TrackProColors` as a data class (`TrackProColorScheme`). Updated `DarkTrackProColors` with refined hex values and added a `LightTrackProColors` palette.
* **Color Mapping:** Renamed several color keys for clarity (e.g., `AccentRed` and `AccentGreen` are often replaced by `accentCyan` and `accentBlue`).
* **Legacy Cleanup:** Deleted the old `theme/Color.kt` and `theme/Theme.kt` files.
* **UI Components & Screens:**
* Updated all major screens (`TrackScreen`, `TimeAttackListView`, `DragScreen`, `LapDetailScreen`, etc.) to use the new `TrackProTheme.colors` accessor.
* Adjusted background and accent colors across various UI elements:
* Replaced hardcoded color values with themed colors in list items and cards.
* Updated `CircularProgressIndicator` colors to match the new theme accents.
* Standardized `HorizontalDivider` and `VerticalDivider` colors using `sectorLine`.
* **`MainActivity.kt`:** Refactored the `ModalNavigationDrawer` and main "Action Grid" to utilize the new theme colors.
* **Configuration:**
* **`config.json`:** Updated the default `ip_address` from `192.168.4.1` to `10.0.2.2` (typically used for Android Emulator loops).
* **Miscellaneous:**
* Cleaned up unused imports and standardized the location of theme-related classes.
* Fixed a package reference for `convertToUnixTimestamp` in `ESPTcpClient.kt`.
This commit enhances the `DragTimesList` screen by adding a top header bar that displays the record type and total session count.
**Key Changes:**
* **`DragTimesList.kt`:**
* Wrapped the `LazyColumn` in a `Column` to accommodate a new header.
* Added a header `Box` with an `accentCyan` background.
* The header includes a title "● Drag RECORDS" and a session counter (e.g., "X SESSIONS") styled with specific font sizes, weights, and letter spacing.
* Imported `androidx.compose.ui.graphics.Color` to support header text styling.
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.
Added new data for drag screen and view, reworked the light/dark theme and modified colors.
Minor fixes