Grow Animation For Floating Action Button
What I Have I have a Floating Action Button on the bottom of the screen. What I Want I want to animate the view when the activity resumes. The animation would grow the FAB from siz
Solution 1:
I got the solution myself actually. It was quite simple.
I created this animation in XMl and saved it in "anim".
<setxmlns:android="http://schemas.android.com/apk/res/android"android:fillAfter="true"><scaleandroid:duration="250"android:fromXScale="0.0"android:fromYScale="0.0"android:interpolator="@android:anim/accelerate_interpolator"android:pivotX="50%"android:pivotY="50%"android:startOffset="500"android:toXScale="1.0"android:toYScale="1.0" /></set>
After that its just loading and playing the animation on the view,
Animationanimation= AnimationUtils.loadAnimation(getActivity(), R.anim.fab_grow);
start.startAnimation(animation);
That's it. You are done and good to go.
Post a Comment for "Grow Animation For Floating Action Button"