Skip to content

Instantly share code, notes, and snippets.

@talhahasanzia
Created June 23, 2017 07:58
Show Gist options
  • Save talhahasanzia/1035df71440a1e2b07b1aa9f6d057e5e to your computer and use it in GitHub Desktop.
Save talhahasanzia/1035df71440a1e2b07b1aa9f6d057e5e to your computer and use it in GitHub Desktop.
Android flip view vertical animation (native).
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