hsv-alpha-color-picker-android
hsv-alpha-color-picker-android copied to clipboard
Thumbnail color doesn't update
We're using a couple of ColorPreference in a PreferenceFragment, the XMLfor the fragment is as follows;
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.rarepebble.colorpicker.ColorPreference
android:key="text_color"
android:title="@string/text_color_title"
app:colorpicker_showHex="false" />
<com.rarepebble.colorpicker.ColorPreference
android:key="background_color"
android:title="@string/background_color_title"
app:colorpicker_showHex="false" />
</PreferenceScreen>
When changing the text_color preference, the onPreferenceChange listener is fired, however, the thumbnail does not update, regardless of whether setColor() is called or not on the changing preference within the listener.
When changing the background_color preference, the thumbnail updates correctly.
Are you returning false
from your onPreferenceChange()
function? That (correctly) causes the color not to update for me.
It's returning true always. I resolved the issue by adding a PreferenceCategory. It appears if the ColorPreference is the first item, the thumbnail does not update.
I pasted your XML into the demo app and everything works correctly for me. If you want a proper fix, I'll need more information and/or code. (Or even better, a pull request :-)
I have the same exact issue. This is how I declare the Color Picker
<com.rarepebble.colorpicker.ColorPreference
android:icon="@drawable/ic_format_color_fill_white_24dp"
android:key="racer.accent"
android:title="Accent Color"
android:summary="Set the Watchface accent color."
app:colorpicker_defaultColor="#f00"/>
With or without a Category the Thumbnail does not update but I can confirm that the preference is changed.
Can you confirm that you're using the latest version of the library (1.6.0)? Also, what Android version(s) do you see it on? Does it happen on the emulator?
Yes I am using the latest version on android 5.1.1 and 6.0 It happens on Nexus 6, Samsung s5 and virtual devices On 25 Jan 2016 21:23, "Martin Stone" [email protected] wrote:
Can you confirm that you're using the latest version of the library (1.6.0)? Also, what Android version(s) do you see it on? Does it happen on the emulator?
— Reply to this email directly or view it on GitHub https://github.com/martin-stone/hsv-alpha-color-picker-android/issues/17#issuecomment-174628180 .
Hmm. Working for me on 5.1.1 emulator (and all my other devices). Are you building the library locally or using the jcenter version? What are your target version and min sdk version? Any other relevant setup you can think of?
Maybe you could debug the library locally and put a breakpoint in ColorPreference.showColor() and see what's going on.
I am using jcenter but I was considering to fork git and debug it. Min sdk is 16 On 25 Jan 2016 9:58 pm, "Martin Stone" [email protected] wrote:
Hmm. Working for me on 5.1.1 emulator (and all my other devices). Are you building the library locally or using the jcenter version? What are your target version and min sdk version? Any other relevant setup you can think of?
Maybe you could debug the library locally and put a breakpoint in ColorPreference.showColor() and see what's going on.
— Reply to this email directly or view it on GitHub https://github.com/martin-stone/hsv-alpha-color-picker-android/issues/17#issuecomment-174640589 .
Well, I'm out of ideas here. If you could investigate with a debugger, that would be helpful.
I'll give it a shot and try to understand why it does not update the activity On 25 Jan 2016 10:04 pm, "Martin Stone" [email protected] wrote:
Well, I'm out of ideas here. If you could investigate with a debugger, that would be helpful.
— Reply to this email directly or view it on GitHub https://github.com/martin-stone/hsv-alpha-color-picker-android/issues/17#issuecomment-174642443 .