Android: How to achieve the glow effect when long-pressing a list item?

Viewed 7822

With the default selector, long-pressing a list item causes its background to transition between two colors.

Replacing the selector with the one below removes the effect. According to this question, I need an animation to reproduce it. How would I go about doing that in xml?

<?xml version="1.0" encoding="utf-8"?>
<selector
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:state_pressed="true">
        <shape>
            <solid
                android:color="@color/state_pressed" />
        </shape>
    </item>
    <item
        android:state_focused="true">
        <shape>
            <solid
                android:color="@color/state_focused" />
        </shape>
    </item>
    <item>
        <shape>
            <solid
                android:color="@color/state_idle_grey" />
        </shape>
    </item>
</selector>
1 Answers
Related