Vamsi Challa Vamsi Challa - 3 months ago 17
Android Question

Android Animations - Transform button to FAB

I have a button, which i want to transform into a FAB. Please see the below animation for reference. Can someone let me know how to achieve this.

enter image description here

Answer
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator">

    <scale
        android:duration="700"
        android:fillBefore="false"
        android:fromXScale="1.0"
        android:fromYScale="1.0"
        android:pivotX="50%p"
        android:pivotY="50%p"
        android:toXScale="0.0"
        android:toYScale="1.0" />

</set>

It was a simple scale animation.

Comments