Android過渡動畫解釋結合的例子:Material-Animations

jopen 9年前發布 | 17K 次閱讀 Android開發 移動開發 Material-Animations

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.baiduhome.net/lib/view/home/1443193035966

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!