martin-stone / hsv-alpha-color-picker-android

A color picker and a color preference for use in Android applications.
Apache License 2.0
290 stars 60 forks source link

resize the thumbnail in setting page #23

Open ghost opened 8 years ago

ghost commented 8 years ago

Is it possible to resize the color picker thumbnail in the setting page? for instance, make it the same size as the checkbox or make it a small circle. thanks

martin-stone commented 8 years ago

If you're building the library locally, you should be able to simply change the value for preference_thumbnail_size in dimens.xml:

https://github.com/martin-stone/hsv-alpha-color-picker-android/blob/d60035f78eeb82e3cec9524fa1c2da79c61c3c28/colorpicker/src/main/res/values/dimens.xml#L6

It's not user-configurable if you're just linking to the library.

ghost commented 8 years ago

@martin-stone I just added to gradle . Is it possible to make it user configurable via the xml? something like this:

 <com.rarepebble.colorpicker.ColorPreference
            android:key="simplePreference"
            android:title="@string/pref_title"
            app:colorpicker_defaultColor="#f00"
            **app:preference_thumbnail_size="25dp"** 
            />

in that case it would be awesome.

martin-stone commented 8 years ago

I'm happy to consider a pull request. (Otherwise I'm not sure when I'll get time to look at it.)