简体   繁体   中英

Gluon Mobile FloatingActionButton (FAB) animation

I managed to get a second FAB on the left side of the view.

commentFab.setFloatingActionButtonHandler(FloatingActionButton.BOTTOM_LEFT);

But it does so with an animation. How can I remove the animation?

A FAB is intended for a primary action. Material Design guidelines recommend just one FAB:

Only one floating action button is recommended per screen to represent the most common action.

and with animation:

It animates onto the screen as an expanding piece of material, by default.

Gluon's FloatingActionButton are designed with a translate animation when they are laid out after they are added to the View.

To avoid that transition, you could play with the fab's visibility: set it to false, create an pause transition, add the fab to the layer, and set the fab's visibility to true when the pause transition ends.

In my opinion, you should use a different Layer implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM