-
-
Notifications
You must be signed in to change notification settings - Fork 128
Bubble level change color when reach threshold #3241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Bubble level change color when reach threshold #3241
Conversation
|
I left a few minor comments but functionality wise that looks great |
| getString(R.string.pref_bubble_level_threshold), | ||
| { prefs.threshold.toInt() }, | ||
| { prefs.threshold = it.toFloat() }, | ||
| minValue = 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to make the minimum value 0? That way if a user doesn't want it to show they can set it to 0 and it should never appear
| import com.kylecorry.trail_sense.R | ||
| import com.kylecorry.trail_sense.shared.preferences.PreferencesSubsystem | ||
|
|
||
| class BubbleLevelPreferences(private val context: Context) : IBubbleLevelPreferences { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this extend the PreferenceRepo as well?
(that removes the need to define cache)
| { prefs.threshold = it.toFloat() }, | ||
| minValue = 1, | ||
| maxValue = 10, | ||
| formatValue = { getString(R.string.degree_format, it.toFloat()) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the FormatService be used?
Available with AppServiceRegistry.get()
Description
Overview
Adds a user-configurable threshold setting for the Bubble Level tool in settings. (Persists across app sessions)
The bubble background color changes based on this custom threshold.
Changes:
BubbleLevelPreferencesto store threshold setting (default: 2°)BubbleLevelSettingsFragmentwith number pickerBubbleLevelbased on thresholdRelated Issue
The following PR includes the functionality requested in issue #3224
Checklist
Screenshots
screen-20251124-182948.mp4