skydoves / ColorPickerPreference

🎨 A library that lets you implement ColorPicker, ColorPickerDialog, ColorPickerPreference.
Apache License 2.0
476 stars 51 forks source link

app:default_color documentation #31

Open fmccown opened 2 years ago

fmccown commented 2 years ago

The documentation is missing a default value (app:default_color), so users may not know how to specify one. Example:

  <com.skydoves.colorpickerpreference.ColorPickerPreference
    android:key="@string/BackgroundColorPickerPreference"
    android:summary="changes background color"
    android:title="Background Color"
    app:default_color="@color/md_yellow_A700"
    app:iconSpaceReserved="false"
    app:preference_dialog_negative="@string/cancel"
    app:preference_dialog_positive="@string/confirm"
    app:preference_dialog_title="Background ColorPickerDialog"
    app:preference_selector="@drawable/wheel" />

On a side note, preferences usually use app:defaultValue to specify a default value. It would be a good idea to be consistent and do the same. You may also want to use camelCasing for your attributes.

meemanali commented 9 months ago

Thanks for pointing this. But neither app:default_color nor app:initialColor is working in my case. Also app is crashing while showing this dialog on higher versions of Android.