Created
November 14, 2020 00:08
-
-
Save Nyame123/88233aeedf30e7e692e68911372de5b1 to your computer and use it in GitHub Desktop.
Creating a state list animator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_pressed="true"> | |
<set > | |
<objectAnimator android:propertyName="scaleX" | |
android:duration="@android:integer/config_shortAnimTime" | |
android:valueTo="1.2" | |
android:valueType="floatType"/> | |
<objectAnimator android:propertyName="scaleY" | |
android:duration="@android:integer/config_shortAnimTime" | |
android:valueTo="1.2" | |
android:valueType="floatType"/> | |
<objectAnimator | |
android:duration="@android:integer/config_shortAnimTime" | |
android:propertyName="translationZ" | |
android:valueTo="10" | |
android:valueType="floatType" /> | |
</set> | |
</item> | |
<item android:state_pressed="false"> | |
<set> | |
<objectAnimator android:propertyName="scaleX" | |
android:duration="@android:integer/config_shortAnimTime" | |
android:valueTo="1" | |
android:valueType="floatType"/> | |
<objectAnimator android:propertyName="scaleY" | |
android:duration="@android:integer/config_shortAnimTime" | |
android:valueTo="1" | |
android:valueType="floatType"/> | |
<objectAnimator | |
android:duration="@android:integer/config_shortAnimTime" | |
android:propertyName="translationZ" | |
android:valueTo="2" | |
android:valueType="floatType" /> | |
</set> | |
</item> | |
</selector> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment