preface

  • The use of animation isAndroidKnowledge commonly used in development
  • However, the variety of animation, the use of complex, whenever the need to use custom animation to achieve complex animation effects, many developers seem helpless
  • This article will present oneAndroidA comprehensive introduction of animation walkthrough, including the types of animation, use, principle, etc.It gives you a better grasp of animation to achieve more complex animation effects

directory


1. Animation type

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


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



  • The following. I will introduce in detail the use & principles of these two categories and three kinds of animation

2. View Animation

  • Object: View (View)
  • Specific classification: tween animation & frame by frame animation

Both view animations are described in detail below

2.1 Tween Animation

  • Introduction to the

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

    Different types of animation correspond to different subclasses

  • See the article Android animation: Hand in hand to teach you how to use tween animation

2.2 Frame-by-frame animation

  • Introduction to the

  • See article Android frame by frame animation for details: The use of frame by frame animation is here!


3. Property animation

3.1 Why use property animation

  • Property animation (Property Animation) is theThe Android 3.0(API 11) after a new animation mode is provided
  • So why provide a Property Animation?

  • Please see the figure below for details.

3.2 Introduction

  • Introduction to the

  • The specific use

    The main classes used for property animation are:ValueAnimatorClass &ObjectAnimatorClass, the details are as follows

For more details, see the article Android Property animation: This is a very detailed property animation summary & walkthrough


4. Animation summary & comparison

4.1 summarize

4.2 Differences between the two types of animation

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

  • View animation: Does not change the properties of the animation because the view animation only transforms the image during the animation, thus achieving the animation effect

Transformation operations include: pan, scale, rotate, and transparent

  • Attribute animation: change the animation properties because attribute animation in the animation process to dynamically change the object properties, so as to achieve the animation effect

  • Pay special attention to View animations: The View stays in position no matter where the animation result is & the response area stays in place and does not move based on the result; Property animation, on the other hand, changes properties to make the animation move


5. Interpolator & estimator

5.1 introduction

5.2 Usage

See article: Android Animation: Can you really use interpolators and estimators? (including detailed example teaching)


6. Usage questions & Suggestions

  • There are a number of issues to be aware of when using animation
  • Below, I will give a comprehensive overview of the usage issues & suggestions in the animation process


7. To summarize

  • In this paper,AndroidAnimation has been analyzed in detail, and I believe that you can achieve complex animation effects through this article
  • A series of articles on Android animation

    1. This is a very detailed property animation summary & walkthrough Android animation: Hand-by-hand teach you to use tween animation Android frame by frame animation: about the use of frame by frame animation are here! Android Animation: Do you really know how to use interpolators and estimators? (including detailed example teaching)
    2. The principle of custom View, please refer to my article: (1) custom View basis – the most understandable custom View principle series (2) custom View Measure process – the most understandable custom View principle series (3) custom View Layout process – the most understandable custom View principle series (4) custom View Draw process – the most understandable custom View principle series
    3. Custom View application, please refer to the article I wrote: Why doesn’t your custom View wrap_content work? Why doesn’t wrap_content work?
  • Next, I will continue to analyze the knowledge related to Android. If you are interested, please continue to pay attention to Carson_Ho’s Android development notes


Thumb up, please! Because your approval/encouragement is my biggest motivation to write!