public class DrawableCrossFadeFactory extends Object implements TransitionFactory<Drawable>
Transition
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 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
.
Modifier and Type | Class and Description |
---|---|
static class |
DrawableCrossFadeFactory.Builder
A Builder for
DrawableCrossFadeFactory . |
Modifier | Constructor and Description |
---|---|
protected |
DrawableCrossFadeFactory(ViewAnimationFactory<Drawable> viewAnimationFactory,
int duration,
boolean isCrossFadeEnabled) |
Modifier and Type | Method and Description |
---|---|
Transition<Drawable> |
build(DataSource dataSource,
boolean isFirstResource)
Returns a new
Transition . |
protected DrawableCrossFadeFactory(ViewAnimationFactory<Drawable> viewAnimationFactory, int duration, boolean isCrossFadeEnabled)
public Transition<Drawable> build(DataSource dataSource, boolean isFirstResource)
TransitionFactory
Transition
.build
in interface TransitionFactory<Drawable>
dataSource
- The DataSource
the resource was loaded
from.isFirstResource
- True if this is the first resource to be loaded into the target.