Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Property animations vs View animations for new Android code

I am new to Android animations and am reading the introductory articles. The developer guide says that View animation is an older system and easy to use

As a beginner, should I invest any time understanding how view animations work, or should I focus completely on Property animations ? Is there something property animations are not capable of doing ? Is it "comparatively" very difficult to use property animation for simple stuff like rotate/translate ?

like image 842
dev Avatar asked Feb 15 '14 22:02

dev


People also ask

What are the two different types of view animations in Android?

The animations are basically of three types as follows: Property Animation. View Animation. Drawable Animation.

What is Property animation in Android?

A property animation changes a property's (a field in an object) value over a specified length of time. To animate something, you specify the object property that you want to animate, such as an object's position on the screen, how long you want to animate it for, and what values you want to animate between.

What is the difference between ValueAnimator and ObjectAnimator?

As shown in code above, ValueAnimator is almost like ObjectAnimator , except it doesn't have a specific view to target. It has to have a listener — i.e. addUpdateListner — to listen to the value change and behave accordingly. This added more code, but better customization for it.


1 Answers

As a beginner, should I invest any time understanding how view animations work, or should I focus completely on Property animations ?

I suggest that you focus completely on property animations. At this point, you should be focused on Android 3.0+, where property animations are available. If you need to get your code working on older devices, NineOldAndroids offers a backport of some of the property animation APIs.

Is there something property animations are not capable of doing ?

Not that I can think of. Property animations are substantially more powerful, less of a hassle, and more efficient.

Is it "comparatively" very difficult to use property animation for simple stuff like rotate/translate ?

IMHO, it is substantially easier to use property animations for simple stuff like rotations and translations.

like image 57
CommonsWare Avatar answered Nov 14 '22 22:11

CommonsWare