1

How can I change background color of a pressed list item gradually (like it's done in default list items)? Background of an item currently is a selector:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_activated="true" android:drawable="@color/holo"/>
    <item android:state_pressed="true" android:drawable="@color/grey"/>
    <item android:drawable="@color/white"/>
</selector>

But background color changes instantly, not gradually like in simple_list_item_activated1 layout.

Can the gradual color change of a pressed item be done without coding it manually? How can I do it?

hotkey
  • 140,743
  • 39
  • 371
  • 326
  • Check out the solution [here](http://stackoverflow.com/questions/2614545/animate-change-of-view-background-color-in-android#answer-3208800) – Chris Feist Jun 26 '14 at 23:16
  • Ok, that looks fine, but how can it be applied to ListView items, which should have one more state, when they're `activated`, as in `xml` above? – hotkey Jun 27 '14 at 15:54

0 Answers0