- Keep them short, but appropriate to the action that is happening
- (defaults to 300ms on Android for property animator)
- Keep them smooth
- Don't run layout during animation! Do it first.
- Use the right timing curve
- Keep them natural
- Don't be whizzy for the sake of it, keep it organic to the app
- Keep them purposeful
- No burning windows just for the sake of it
- Make the animation exist for a reason
View.setHasTransientState(true)
, makes the list view leave those views alone while you animate them. If you don't - they might get recycled or whatever!ViewPropertyAnimator
sets this automatically for you
overridePendingTransition(0, 0);
Tells the OS not to do any activity animation - we'll take care of it!- We also call it when we
finish()
so that we customize the exit animation
- We also call it when we
PropertyValuesHolder
,ObjectAnimator
- they're your friends!OvershootInterpolator
gives you a nice wobble/bounce at the end of the animationAnimationSet
for doing a series of animations in sequence- Curved motion feels more natural than straight-line motion
- Avoid layout during the animation
ViewTreeObserver
can be used to listen to global events in the view hierarchy