Class DrawableCrossFadeFactory
- java.lang.Object
-
- com.bumptech.glide.request.transition.DrawableCrossFadeFactory
-
- All Implemented Interfaces:
TransitionFactory<android.graphics.drawable.Drawable>
public class DrawableCrossFadeFactory extends java.lang.Object implements TransitionFactory<android.graphics.drawable.Drawable>
A factory class that produces a newTransitionthat 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 put 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 a transition. As a result, when the resource is loaded from the memory cache this factory produces an
NoTransition.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDrawableCrossFadeFactory.BuilderA Builder forDrawableCrossFadeFactory.
-
Constructor Summary
Constructors Modifier Constructor Description protectedDrawableCrossFadeFactory(int duration, boolean isCrossFadeEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Transition<android.graphics.drawable.Drawable>build(DataSource dataSource, boolean isFirstResource)Returns a newTransition.
-
-
-
Method Detail
-
build
public Transition<android.graphics.drawable.Drawable> build(DataSource dataSource, boolean isFirstResource)
Description copied from interface:TransitionFactoryReturns a newTransition.- Specified by:
buildin interfaceTransitionFactory<android.graphics.drawable.Drawable>- Parameters:
dataSource- TheDataSourcethe resource was loaded from.isFirstResource- True if this is the first resource to be loaded into the target.
-
-