Skip to content

drag_statistics_rework#15

Merged
Aredarn merged 7 commits into
mainfrom
drag_statistics_rework
Jun 16, 2026
Merged

drag_statistics_rework#15
Aredarn merged 7 commits into
mainfrom
drag_statistics_rework

Conversation

@Aredarn

@Aredarn Aredarn commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Added new data for drag screen and view, reworked the light/dark theme and modified colors.
Minor fixes

Aredarn added 7 commits May 20, 2026 08:55
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.
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.
@Aredarn Aredarn self-assigned this Jun 16, 2026
@Aredarn Aredarn merged commit ead1a78 into main Jun 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant