When your UI changes in response to user action, you should animate the layout transitions. These animations give users feedback on their actions and help keep them oriented to the UI.
Android includes the transitions framework, which enables you to easily animate changes between two view hierarchies. The framework animates the views at runtime by changing some of their property values over time. The framework includes built-in animations for common effects and lets you create custom animations and transition lifecycle callbacks.
To get started, watch the video embedded here and read the Animations Overview.
- Animations Overview
- Property Animation Overview
- Animate drawable graphics
- Reveal or hide a view using animation
- Move a View with Animation
- Move views using a fling animation
- Enlarge a view using a zoom animation
- Animate movement using spring physics
- Auto animate layout updates
- Animate layout changes using a transition
- Create a custom transition animation
- Start an activity using an animation
- Slide between fragments using ViewPager
- Slide between fragments using ViewPager2
- Migrate from ViewPager to ViewPager2
For more information about animation, consult the following resources.
- Get Animated (Android Dev Summit '18): Overview of the various animation technologies available. Includes a summary of how to choose between the different animation options.