Created
June 22, 2017 21:26
-
-
Save v3n3/31e02b3ca64ec9e9b32abc7ed514c410 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment