Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: developerY/ProBase
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: developerY/ProBase
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: imperal
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 12 files changed
  • 1 contributor

Commits on Mar 11, 2026

  1. feat(metrics): add support for imperial unit system and formatting

    This commit introduces the infrastructure to toggle and persist imperial unit preferences, along with utility classes to format ride metrics—speed, distance, and elevation—based on the user's selection.
    
    - **`UserProfileRepository.kt` / `DataStoreUserProfileRepository.kt`**:
        - Added `isImperial` preference key and DataStore implementation to persist the user's unit system choice.
    - **`RideMetricsFormatter.kt`**:
        - Introduced a formatter that converts and packages raw values into `DisplayMetric` objects for the UI.
    - **`UnitMath.kt`**:
        - Added extension functions for Float and Double to handle conversions (km to miles, km/h to mph, and meters to feet).
    - **`DisplayMetric.kt`**:
        - Defined a new data class to hold a formatted value string and a localized `@StringRes` for the unit.
    - **`string.xml`**:
        - Added unit label resources for both Metric and Imperial systems.
    developerY committed Mar 11, 2026
    Configuration menu
    Copy the full SHA
    e10a2a2 View commit details
    Browse the repository at this point in the history
  2. feat(wear): implement imperial unit support for ride metrics

    This commit integrates unit preference handling (Metric/Imperial) into the Wear OS ride dashboard. It refactors the UI state to use pre-formatted metrics and updates the speedometer components to support dynamic units and scaling.
    
    - **`WearBikeViewModel.kt`**:
        - Refactored `uiState` to use `combine`, reacting to changes in both ride data and user unit preferences.
        - Integrated `RideMetricsFormatter` to handle distance and elevation string formatting.
        - Added logic to dynamically adjust the speedometer's maximum dial range based on the selected unit (e.g., 40mph vs 60km/h).
    - **`WearBikeUiState.kt`**:
        - Updated state properties to use `DisplayMetric` for pre-formatted strings and unit resource IDs.
        - Added `maxSpeed` and `speedUnitResId` to support dynamic speedometer rendering.
    - **`FancySpeedometer.kt`**:
        - Parameterized `speedUnitText` to remove the hardcoded "km/h" string.
    - **`RideMetricsFormatter.kt` & `build.gradle.kts`**:
        - Added `@Inject` constructor to `RideMetricsFormatter` and included Hilt dependencies in the model module to support dependency injection.
    - **`DataStoreUserProfileRepository.kt`**:
        - Updated `IS_IMPERIAL_DEFAULT` to `true`.
    - **`WearHomeScreen.kt`**:
        - Updated UI components to display formatted strings and units directly from the `uiState`.
    developerY committed Mar 11, 2026
    Configuration menu
    Copy the full SHA
    450789c View commit details
    Browse the repository at this point in the history
Loading