Created
February 8, 2012 05:14
-
-
Save laurencedawson/1765651 to your computer and use it in GitHub Desktop.
Android animation
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
// An exmaple of chaning the layer type and applying | |
// an alpha animation to the view | |
view.setLayerType(View.LAYER_TYPE_HARDWARE, null); | |
ObjectAnimator animator = ObjectAnimator.ofFloat( | |
view, View.ALPHA, 0, 1); | |
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