Android过渡动画解释结合的例子:Material-Animations
jopen
9年前
Android Transition Framework can be used for three main things:
- Animate activity layout content when transitioning from one activity to another.
- Animate shared elements (Hero views) in transitions between activities.
- Animate view changes within same activity.
1. Transitions between Activities
Animate existing activity layout content
When transitioning fromActivity AtoActivity Bcontent layout is animated according to defined transition. There are three predefined transitions available onandroid.transition.Transitionyou can use: Explode, Slide and Fade. All these transitions track changes to the visibility of target views in activity layout and animate those views to follow transition rules.
Explode | Slide | Fade |
---|---|---|
You can define these transitions declarative using XML or programmatically. For the Fade Transition sample, it would look like this: