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.
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.
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.
Can the FormatService be used?
Available with AppServiceRegistry.get()
|
I'm going to merge this and make those minor changes. Thank you for the contribution! |
|
@kylecorry31 Thanks! I apologize for not making those changes myself over the last few weeks; unfortunately, I just couldn't find the time to code. I should have some free time next week, so I can open a follow-up PR for those minor changes 😊 |
No worries! I fixed all of the minor changes after I merged it in, so it is all set and will be included in the January release. |
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