Created
June 23, 2017 07:58
-
-
Save talhahasanzia/1035df71440a1e2b07b1aa9f6d057e5e to your computer and use it in GitHub Desktop.
Android flip view vertical animation (native).
This file contains hidden or 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 FlipViewAnimation{ | |
public static void flip( View firstView, View secondView, float duration) | |
{ | |
firstView.animate().rotationX(90).setDuration(duration).setListener(new AnimatorListenerAdapter() { | |
@Override | |
public void onAnimationEnd(Animator animation) { | |
firstView.setVisibility(View.GONE); | |
secondView.setRotationX(-90); | |
secondView.setVisibility(View.VISIBLE); | |
secondView.animate().rotationX(0).setDuration(200).setListener(null); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment