Animate Fab Button cross to mark

Cilenco

In my Android application I want to have a Floating Action Button to display a success state. I would like to have something like in the picture below:

enter image description here

But I have no idea how to animate the cross to the mark. Can someone please explain to me how I can do that? Is there maybe a library or something like that? Atm I'm using the default FAB from the design library.

Alex Townsend

This question got me interested in checking out AnimatedVectorDrawable, so I went ahead and made a small sample app that will achieve a similar animation, on github here.

Bad quality gif here.

Couple things to note: minimum SDK is set to 23 to make use of AnimationCallbacks for starting the 2nd animation, but you can achieve the same result using a Handler.postDelayed() with your animation durations to handle the drawable change and animation start. Since AnimatedDrawableCompat does not support path morphing, I needed two drawables to get the two different images.

Should be compatible with the Support Library AnimatedVectorDrawableCompat if you choose to use it as well.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Adjust icon size of Floating action button (fab)

From Dev

Hiding the image not found cross mark using .htaccess

From Dev

How to animate and rotate a button

From Dev

Android L - Floating Action Button (FAB)

From Dev

Android L FAB Button shadow

From Dev

Animate view on button click android

From Dev

Difference between Floating action button (FAB) and Raised button

From Dev

FAB does not animate - test code and screenshot attached

From Dev

Android button animate

From Dev

Set FAB (Floating Action Button) above keyboard

From Dev

Fab button on the center of CardView

From Dev

How to animate FAB (expand) to a new Activity

From Dev

FAB (floating action button) doesn't float

From Dev

How to remove auto padding of FAB button in android?

From Dev

windows 8 bind button to > and < mark

From Dev

Material Design Floating Button (FAB) Blocking RecyclerView

From Dev

Difference between Floating action button (FAB) and Raised button

From Dev

FAB does not animate - test code and screenshot attached

From Dev

Animate bootstrap burger menu to cross

From Dev

GalleryView with Cross Button

From Dev

Angular Material FAB Dial button

From Dev

How to disable ion-fab button?

From Dev

UITableViewCell animate button constraint

From Dev

Cursor became cross-mark

From Dev

error with fab button design with vector assets

From Dev

Android: Animate FAB on tab change

From Dev

MaterializeCSS Using Icon As FAB Button [FeatureDiscovery]

From Dev

how i use fab Button on menu

From Dev

How to make FAB animate out when removing it?