Skip to content
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

Thumbnail color doesn't update #17

Open
versoworks opened this issue Jan 19, 2016 · 10 comments
Open

Thumbnail color doesn't update #17

versoworks opened this issue Jan 19, 2016 · 10 comments

Comments

@versoworks
Copy link

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.

@martin-stone
Copy link
Owner

Are you returning false from your onPreferenceChange() function? That (correctly) causes the color not to update for me.

@versoworks
Copy link
Author

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.

@martin-stone
Copy link
Owner

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 :-)

@raffaeu
Copy link

raffaeu commented Jan 25, 2016

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.

@martin-stone
Copy link
Owner

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?

@raffaeu
Copy link

raffaeu commented Jan 25, 2016

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" notifications@github.com 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
#17 (comment)
.

@martin-stone
Copy link
Owner

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.

@raffaeu
Copy link

raffaeu commented Jan 25, 2016

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" notifications@github.com 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
#17 (comment)
.

@martin-stone
Copy link
Owner

Well, I'm out of ideas here. If you could investigate with a debugger, that would be helpful.

@raffaeu
Copy link

raffaeu commented Jan 25, 2016

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" notifications@github.com 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
#17 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants