Open
Conversation
fixed now in Stats, RegionsVisited and CountriesVisited
…om/vide/matedroid into feat/imperial-metric-user-selector
Collaborator
Author
|
Note: |
Placed in Settings view, under Extra Settings
m for metric units and ft for imperial units
cfbbf37 to
27be4a2
Compare
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.
Summary
Closes #181
Adds a unit system selector in Settings that allows users to override the units configured on their vehicle. The new control offers three options: Auto (uses the vehicle's configured units), Metric (forces km/km/h), and Imperial (forces mi/mph), persisted across sessions via DataStore.
Previously, unit display depended entirely on the vehicle's configuration and was inconsistently applied across screens. This change ensures the user's preference is respected uniformly throughout the app.
Changes
Settings
SingleChoiceSegmentedButtonRowwith Auto / Metric / Imperial options to the Display sectionunitsOverridefield toSettingsUiStateandAppSettingsunitsOverrideKey,unitsOverrideFlow andsaveUnitsOverride()toSettingsDataStoreupdateUnitsOverride()toSettingsViewModelUnit resolution
DrivesViewModel,DriveDetailViewModel,DashboardViewModel,StatsViewModel,MileageViewModel,CountriesVisitedViewModelandRegionsVisitedViewModelnow readunitsOverridefromSettingsDataStoreand apply it on top of the vehicle's reported unitsScreens updated to respect user preference
DrivesScreen— drive list, summary card and chartsDriveDetailScreen— all detail statsDashboardScreen— viaUnitFormatter, no changes needed beyond ViewModel fixStatsScreen— quick stats, records and range record dialogMileageScreen— all levels (year, month, day, drive row) including chart tooltipsCountriesVisitedScreen— distance chips per countryRegionsVisitedScreen— country summary card, region cards and map marker snippets