ui: animate selection
Animate the check mark and background change when a item is selected. This produces a nicer UX overall. If possible, I'm planning to also port this to the other indicators in ImageGroup, albeit doing that is signifigantly harder.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:enterFadeDuration="150"
|
||||
android:exitFadeDuration="150">
|
||||
|
||||
<item
|
||||
android:id="@+id/pressed"
|
||||
android:state_activated="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/sel_item_activated_bg" />
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:id="@+id/def">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/sel_item_activated_bg" />
|
||||
</shape>
|
||||
</item>
|
||||
</animated-selector>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/sel_activatable_background" />
|
||||
<item android:drawable="@drawable/sel_item_ripple_bg" />
|
||||
<item android:drawable="?attr/selectableItemBackground" />
|
||||
</layer-list>
|
||||
Reference in New Issue
Block a user