Using ObjectAnimatorObjectAnimator is a powerful animation framework introduced in Android 3.0, which is used to animate the properties of any object. You can use ObjectAnimator to change the translationX and translationY properties of a View to implement the translation animation of a View. Using ValueAnimatorValueAnimator is a lower-level animation framework that generates a series of values during the animation process and then uses these values to update the properties of the View. For translation animation, update the translationX and translationY properties of the View by listening to the value changes of ValueAnimator. Using ViewPropertyAnimatorStarting from Android 3.0, the View class provides an animate() method that returns a ViewPropertyAnimator object that can be used to chain multiple animation methods. Using XML AnimationAnimations can be defined in XML files and loaded and applied when needed. Note: When using the startAnimation() method, the position of the View will be reset to its original position after the animation ends, unless you manually update the position of the View at the end of the animation. If you want the View to remain in its final position after the animation ends, consider using the ObjectAnimator, ValueAnimator, or ViewPropertyAnimator methods mentioned above. Using drawBitmapDraw pictures at different positions through drawBitmap, which is suitable for the need of using pictures as translation animation. |
<<: Several methods to implement delayed operation in Android development
>>: iOS 18 new features only support iPhone 15 Pro and above!
Overview When developing for Android, you will de...
The painting below is by the artist Martin Drolli...
Domestic mobile phones achieved amazing sales on ...
As a veteran who has been in the APP promotion in...
Through the exaggerated expression of Murphy'...
Ma Bingshi-Python big data full stack engineering...
Bilibili (English name: bilibili, referred to as ...
【Today’s cover】 Now is the busy season for shovel...
With the continuous improvement of the rule of law...
On August 27, at the first China Smart TV Industr...
Renowned hematologist Wang Zhenyi, academician of...
If your boss is a fanatic about offline and onlin...
I recently saw a video where a small noodle shop ...
What is knowledge marketing? Answer: Knowledge ma...
If the host is the "face" we see when w...