Android Animation: This is a detailed & clear animation study guide

foreword

  • The use of animation is a common knowledge in Androiddevelopment
  • However, there are many kinds of animations and complicated use . Whenever they need to use custom animations to achieve complex animation effects , many developers seem helpless.
  • This article will provide a Androidcomprehensive introduction to animation, including the type, use, principle, etc. of animation, so that you can better grasp animation and achieve more complex animation effects

content

Schematic


1. Types of animations

  • AndroidAnimation is divided into two categories: view animation & property animation, as follows:

Among them, view animation is divided into: tween animation & frame-by-frame animation

type of animation

  • under. I will introduce the use & principles of these two categories and three animations in detail

2. View Animation

  • Action object: view ( View)
  • Specific classification: tween animation & frame-by-frame animation

These two view animations are described in detail below.

##2.1 Tween Animation

  • Introduction

    Schematic

  • Classification According to different animation effects, the tween animation is divided into 4 kinds of animations, as shown in the figure below.

Different types of animation correspond to different subclasses

Schematic


2.2 Frame by frame animation


3. Property animation

3.1 Why use property animation

  • Property animation ( Property Animation) is a new animation mode provided after Android 3.0( )API 11

  • So why provide property animation( Property Animation)?

  • Please see the picture below for details

Schematic

3.2 Specific introduction

  • Introduction

    Schematic

  • The specific use classes of attribute animation are mainly: ValueAnimatorclass & ObjectAnimatorclass, the details are as follows

    Mainly used class

For more detailed usage, please read the article: Android Attribute Animation: This is a very detailed attribute animation summary & strategy


4. Animation Summary & Comparison

4.1 Summary

Schematic

4.2 The difference between the two types of animation

The fundamental difference between the two types of animation is whether to change the properties of the animation itself :

  • View animation: There is no property to change the animation because the view animation only transforms the image during the animation process, thus achieving the animation effect

Transform operations include: translation, scaling, rotation, and transparency

  • Property animation: Changed the animation properties. Because property animation dynamically changes the object properties during the animation process, the animation effect is achieved.

  • Pay special attention when using view animation: no matter where the animation result is, the position of the View remains the same & the response area is in place and will not move according to the result; while property animation will make the animation move by changing the properties


5. Interpolator & Estimator

5.1 Introduction

Schematic

5.2 Specific use

See the article: Android Animation: Do You Really Use Interpolators and Estimators? (including detailed example teaching)


6. Usage Questions & Suggestions

  • There are many issues to be aware of when using animations
  • Below, I will comprehensively introduce the use problems & suggestions in the animation process
    Schematic

7. Summary

  • This article has Androidcarried out a detailed analysis of animation, I believe that through this article you can already achieve complex animation effects
  • A series of articles about Androidanimation
  1. For the use of animation, please refer to the article:

Android property animation: This is a very detailed property animation summary & strategy

Android animation: teach you how to use tween animation

Android Frame-by-Frame Animation: The use of frame-by-frame animation is all here!

Android animation: do you really use interpolators and estimators? (including detailed example teaching)

  1. For the principle of customizing View, please refer to the article I wrote:

    (1) Custom View Basics - The most understandable series of custom View principles

    (2) Custom View Measure process - the most understandable series of custom View principles

    (3) Custom View Layout process - the most understandable series of custom View principles

    (4) Custom View Draw process - the most understandable series of custom View principles

  2. For the application of custom View, please refer to the article I wrote:

    Teach you how to write a complete custom View

    The most comprehensive and detailed explanation of the Path class - custom View application series

    The most comprehensive and detailed explanation of the Canvas class - custom View application series

    Why is your custom View wrap_content not working?


Please like! Because your approval/encouragement is the biggest motivation for my writing!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325368736&siteId=291194637