Animation on the Floating Action Button

Asked

Viewed 574 times

0

Does anyone know how to do the Floating Action Button animation shown in the video below?

https://www.youtube.com/watch?v=oVKQfCZ3z2g&feature=youtu.be

I decompiled the apk of this app and could see that this animation is not done with Resources, but via code (maybe it is possible, but this is not done so).

1 answer

0


Here is the answer:

scale_fab_in.xml

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:fromXScale="0"
    android:fromYScale="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="1"
    android:toYScale="1"
    android:interpolator="@android:interpolator/overshoot"/>

scale_fab_out.xml

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="400"
    android:fromXScale="1"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="0"
    android:toYScale="0"
    android:interpolator="@android:interpolator/overshoot"/>

From here on:

https://stackoverflow.com/questions/27922191/floating-action-button-animation/27922318#27922318

Browser other questions tagged

You are not signed in. Login or sign up in order to post.