Android过渡动画解释结合的例子:Material-Animations

jopen 8年前

Android Transition Framework can be used for three main things:

  1. Animate activity layout content when transitioning from one activity to another.
  2. Animate shared elements (Hero views) in transitions between activities.
  3. Animate view changes within same activity.

1. Transitions between Activities

Animate existing activity layout content

A Start B

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
transition_explode transition_slide transition_fade

You can define these transitions declarative using XML or programmatically. For the Fade Transition sample, it would look like this:

项目主页:http://www.open-open.com/lib/view/home/1443193035966