Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class NinetyDegRotationTransition implements FabulousTransition {
- private static final int MAIN_FAB_ANIMATION_DURATION = 200;
- @NotNull
- @Override
- public AnimatorSet getClosingAnimation(@NotNull View element, float destX, float destY) {
- AnimatorSet anim = new AnimatorSet();
- ObjectAnimator fabX = ObjectAnimator.ofFloat(element, View.ROTATION, 0);
- fabX.setDuration(MAIN_FAB_ANIMATION_DURATION);
- anim.play(fabX);
- return anim;
- }
- @NotNull
- @Override
- public AnimatorSet getOpeningAnimation(@NotNull View element, float destX, float destY) {
- AnimatorSet anim = new AnimatorSet();
- ObjectAnimator fabX = ObjectAnimator.ofFloat(element, View.ROTATION, 90);
- fabX.setDuration(MAIN_FAB_ANIMATION_DURATION);
- anim.play(fabX);
- return anim;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement