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

java.lang.Object
  extended by com.bumptech.glide.request.animation.DrawableCrossFadeViewAnimation.DrawableCrossFadeFactory<T>
All Implemented Interfaces:
GlideAnimationFactory<T>
Enclosing class:
DrawableCrossFadeViewAnimation<T extends Drawable>

public static class DrawableCrossFadeViewAnimation.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 producdes an NoAnimation.


Constructor Summary
DrawableCrossFadeViewAnimation.DrawableCrossFadeFactory()
           
DrawableCrossFadeViewAnimation.DrawableCrossFadeFactory(Animation defaultAnimation, int duration)
           
DrawableCrossFadeViewAnimation.DrawableCrossFadeFactory(Context context, int defaultAnimationId, int duration)
           
DrawableCrossFadeViewAnimation.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

DrawableCrossFadeViewAnimation.DrawableCrossFadeFactory

public DrawableCrossFadeViewAnimation.DrawableCrossFadeFactory()

DrawableCrossFadeViewAnimation.DrawableCrossFadeFactory

public DrawableCrossFadeViewAnimation.DrawableCrossFadeFactory(int duration)

DrawableCrossFadeViewAnimation.DrawableCrossFadeFactory

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

DrawableCrossFadeViewAnimation.DrawableCrossFadeFactory

public DrawableCrossFadeViewAnimation.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.