T
- The type of the Drawable
that will be animated.public class DrawableCrossFadeFactory<T extends Drawable> extends Object implements GlideAnimationFactory<T>
GlideAnimation
that varies depending
on whether or not the drawable was loaded from the memory cache and whether or not the drawable is the first
image to be set on the target.
Resources are usually loaded from the memory cache just before the user can see the view,
for example when the user changes screens or scrolls back and forth in a list. In those cases the user
typically does not expect to see an animation. As a result, when the resource is loaded from the memory
cache this factory produces an NoAnimation
.
Constructor and Description |
---|
DrawableCrossFadeFactory() |
DrawableCrossFadeFactory(Animation defaultAnimation,
int duration) |
DrawableCrossFadeFactory(Context context,
int defaultAnimationId,
int duration) |
DrawableCrossFadeFactory(int duration) |
Modifier and Type | Method and Description |
---|---|
GlideAnimation<T> |
build(boolean isFromMemoryCache,
boolean isFirstResource)
Returns a new
GlideAnimation . |
public DrawableCrossFadeFactory()
public DrawableCrossFadeFactory(int duration)
public DrawableCrossFadeFactory(Context context, int defaultAnimationId, int duration)
public DrawableCrossFadeFactory(Animation defaultAnimation, int duration)
public GlideAnimation<T> build(boolean isFromMemoryCache, boolean isFirstResource)
GlideAnimationFactory
GlideAnimation
.build
in interface GlideAnimationFactory<T extends Drawable>
isFromMemoryCache
- True if this will be an animation for a resource that was loaded from the memory cache.isFirstResource
- True if this is the first resource to be loaded into the target.