HorizontalPicker icon indicating copy to clipboard operation
HorizontalPicker copied to clipboard

Maybe make it easier to style selected item (i.e. color and size)

Open isuPatches opened this issue 8 years ago • 5 comments

it'd be cool to have methods to set the color and size of the selected item

isuPatches avatar Aug 24 '15 22:08 isuPatches

Was looking for something with that capability. It would be really good to have.

ArcherN9 avatar Feb 24 '16 07:02 ArcherN9

Color can already be set through textColor parameter. Selected state is for the middle item.

Test size for selected item is a bit trickier since the view would have to calculate text size on every frame. That could cause some performance issue.

blazsolar avatar Feb 24 '16 07:02 blazsolar

Can you please elaborate on how we can achieve that? Thank you!

ziad-halabi9 avatar Aug 16 '16 20:08 ziad-halabi9

Hello fellow coders! If anyone has implemented this enhancement, Please help me. Thanks!

Mandeep221 avatar Aug 24 '16 07:08 Mandeep221

Can you please elaborate on how we can achieve that?

this works.. create an xml file like this one: number_selector.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:color="@color/colorPrimary" android:state_pressed="true"/>
    <item android:color="@color/colorPrimary" android:state_selected="true"/>
    <item android:color="@color/gray_1E1E1E"/>
</selector>

and then use it:

            <com.wefika.horizontalpicker.HorizontalPicker
...
                android:textColor="@drawable/number_selector"

btw - I also wish the text size and/or style could be changed for the selected item.. not sure how hard that'd be to implement

jpage4500 avatar Nov 22 '17 19:11 jpage4500