takisoft / preferencex-android

Android's "androidx.preference" library has some issues, this lib tries to fix them.
Apache License 2.0
55 stars 10 forks source link

ColorPickerPreference current color #17

Closed chitgoks closed 3 years ago

chitgoks commented 3 years ago

what is the correct value for this? if basing on the link provided, 0 is default color but even specifying that in xml doesnt work. it says

error: '0' is incompatible with attribute pref_currentColor (attr) reference [weak].

i only wish to set the default value checked icon on the default color specified.

gregkorossy commented 3 years ago

The pref_currentColor attribute's value must be a reference to a color value (i.e. @color/your_color).

chitgoks commented 3 years ago

ok. somehow e.g. android:defaultValue="#FF00FF" and/or

#FF00FF

app:currentColor(R.color.default_color_picker) doesnt work

Anyway, my purpose is that i thought android:defaultValue or app:currentColor will show the check icon on the color if i set any of those as the default color. but i guess since neither of the 2 attributes work, there is no check icon

red Please see screenshot. it's still red.

This is the xml


 <com.takisoft.preferencex.ColorPickerPreference
            android:defaultValue="#FF00FF"
            android:icon="@null"
            android:key="@string/fill_division_color"
            android:title="@string/fill_division_color"
            app:iconSpaceReserved="false"
            app:pref_currentColor="@color/default_color_picker" />
gregkorossy commented 3 years ago

There's no check mark on the preference. The only place where the check mark is visible is in the dialog where the user selects the color.

chitgoks commented 3 years ago

yes that's true. ok. so this is FAD. im not keen on changing the default color anway so im closing this. thank you for the clarification.