Android ripple color applied for focused and hovered states

464 views Asked by At

I'm trying to implement Button (AppCompatButton) with ripple effect and selector (focused, hovered, disabled etc.). I've created drawable.xml which looks like this:

<ripple android:color="#rippleColor">
    <item><shape android:shape="rectangle">...</shape>
    <item>
        <selector>
            <item android:state_enabled="false">
                <shape>...</shape>
            </item>
            <item android:state_focused="true">
                <shape>...</shape>
            </item>
            ...another states...
        </selector>
    <item>
</ripple>

This code works, but if use d-pad or cursor navigation, when Button is focused or hovered, instead of colors from selector, ripple color is being used.

0

There are 0 answers