Closed tvaknin closed 5 months ago
I don't see this -- It works as expected for me. I'll need more repro steps. (Or a pull request with a fix.)
The above won't work only if you click the "Default" button.
I think this means that it'll be reading your MapColors.TRAIL_RECORDING_DEFAULT.color
value. Is that set correctly?
Hi,
TRAIL_RECORDING_DEFAULT.color is ff002ee3 and not used in case of clicking the "default" button.
This is how I configured the ColorPreference
<com.rarepebble.colorpicker.ColorPreference
android:defaultValue="#ff9933ff"
android:key="trail_recording_color"
android:summary="@string/select_record_color"
android:title="@string/trail_color_recording"
app:colorpicker_selectNoneButtonText="Default"
/>
then, when you click the "Default" it should take ff9933ff but
val routeColor = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()) .getInt("trail_recording_color", MapColors.TRAIL_RECORDING_DEFAULT.color)
return ff002ee instead.
I don't see this issue when trying this. If you could fork the repo and get the demo app to exhibit this, then I'll take another look.
My apologies for the confusion. It was a problem with how I set it up.
Setting android:defaultValue="#ff002ee3"
will result in "ff002ee":
val routeColor = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()) .getInt("trail_recording_color", MapColors.TRAIL_RECORDING_DEFAULT.color)
The above won't work only if you click the "Default" button.