com.bumptech.glide.request.animation
Class DrawableCrossFadeFactory<T extends Drawable>

java.lang.Object
  extended by com.bumptech.glide.request.animation.DrawableCrossFadeFactory<T>
Type Parameters:
T - The type of the Drawable that will be animated.
All Implemented Interfaces:
GlideAnimationFactory<T>

public class DrawableCrossFadeFactory<T extends Drawable>
extends Object
implements GlideAnimationFactory<T>

A factory class that produces a new 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 Summary
DrawableCrossFadeFactory()
           
DrawableCrossFadeFactory(Animation defaultAnimation, int duration)
           
DrawableCrossFadeFactory(Context context, int defaultAnimationId, int duration)
           
DrawableCrossFadeFactory(int duration)
           
 
Method Summary
 GlideAnimation<T> build(boolean isFromMemoryCache, boolean isFirstResource)
          Returns a new GlideAnimation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawableCrossFadeFactory

public DrawableCrossFadeFactory()

DrawableCrossFadeFactory

public DrawableCrossFadeFactory(int duration)

DrawableCrossFadeFactory

public DrawableCrossFadeFactory(Context context,
                                int defaultAnimationId,
                                int duration)

DrawableCrossFadeFactory

public DrawableCrossFadeFactory(Animation defaultAnimation,
                                int duration)
Method Detail

build

public GlideAnimation<T> build(boolean isFromMemoryCache,
                               boolean isFirstResource)
Description copied from interface: GlideAnimationFactory
Returns a new GlideAnimation.

Specified by:
build in interface GlideAnimationFactory<T extends Drawable>
Parameters:
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.