T - The type of the Drawable that will be animated.public class DrawableCrossFadeViewAnimation<T extends Drawable> extends Object implements GlideAnimation<T>
GlideAnimation for Drawables
that uses an TransitionDrawable to transition from an existing drawable
already visible on the target to a new drawable. If no existing drawable exists, this class can instead fall back
to a default animation that doesn't rely on TransitionDrawable.GlideAnimation.ViewAdapter| Constructor and Description |
|---|
DrawableCrossFadeViewAnimation(GlideAnimation<T> defaultAnimation,
int duration)
Constructor that takes a default animation and a duration in milliseconds that the cross fade animation should
last.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
animate(T current,
GlideAnimation.ViewAdapter adapter)
Animates from the previous drawable to the current drawable in one of two ways.
|
public DrawableCrossFadeViewAnimation(GlideAnimation<T> defaultAnimation, int duration)
duration - The duration that the cross fade animation should run if there is something to cross fade from
when a new Drawable is set.public boolean animate(T current, GlideAnimation.ViewAdapter adapter)
animate in interface GlideAnimation<T extends Drawable>current - The new resource that will be displayed in the view.adapter - The GlideAnimation.ViewAdapter wrapping a view that
can at least return an View from
GlideAnimation.ViewAdapter.getView().