Ответ 1
Вот код из list_selector_background:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:drawable="@android:color/transparent" />
<!--
Even though these two point to the same resource, have two states so
the drawable will invalidate itself when coming out of pressed state.
-->
<item android:state_focused="true" android:state_enabled="false"
android:state_pressed="true" android:drawable="@drawable/list_selector_background_disabled" />
<item android:state_focused="true" android:state_enabled="false"
android:drawable="@drawable/list_selector_background_disabled" />
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/list_selector_background_transition" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@drawable/list_selector_background_transition" />
<item android:state_focused="true"
android:drawable="@+drawable/list_selector_background_focus" />
</selector>
Нашел в Интернете.
И он использует этот переход для длительных нажатий:
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/list_selector_background_pressed" />
<item android:drawable="@drawable/list_selector_background_longpress" />
</transition>
Нашел в Интернете.
Для этого нет анимации. И помните, чтобы держать вас в состоянии в том же порядке или, по крайней мере, думать об этом, если вы меняете их, порядок важен.
Лично мне нравится, когда вещи ведут себя стандартным образом, поэтому я бы просто допустил стандартный селектор списка.
С уважением, Stéphane