user5566985
user5566985

Reputation:

ViewPropertyAnimator vsTransitionDrawable

What is the main difference between ViewPropertyAnimator(cross-fade effect) and TransitionDrawable ? Though both seems to achieve the same result of cross-fade effect on image transition.

Upvotes: 1

Views: 89

Answers (1)

Gufran Khurshid
Gufran Khurshid

Reputation: 939

TransitionDrawable is a layered drawable (as it also extends LayerDrawable).It only contains two drawable resources layer intended to cross-fade between the first and second layer.

In order to start the transition, call startTransition(int). To display just the first layer, call resetTransition().More at http://developer.android.com/reference/android/graphics/drawable/TransitionDrawable.html

On other hand,ViewPropertyAnimator is entirely a different component.Its one of many work is to achieve transition between drawable.

ViewPropertyAnimator works similar to ObjectAnimator but it may provide better performance for several simultaneous animations, because it will optimize invalidate calls to take place only once for several properties instead of each animated property independently causing its own invalidation.

Upvotes: 2

Related Questions