Skip to content

Instantly share code, notes, and snippets.

@Amokrane
Created January 30, 2012 23:22
Show Gist options
  • Save Amokrane/1707465 to your computer and use it in GitHub Desktop.
Save Amokrane/1707465 to your computer and use it in GitHub Desktop.
Pattern for writing animations
view.setLayerType(View.LAYER_TYPE_HARDWARE, null);
ObjectAnimator animator = ObjectAnimator.ofFloat(view, "rotationY", 180);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setLayerType(View.LAYER_TYPE_NONE, null);
}
});
animator.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment