public static class DrawableCrossFadeFactory.Builder extends Object
DrawableCrossFadeFactory
.Modifier and Type | Method and Description |
---|---|
DrawableCrossFadeFactory |
build() |
DrawableCrossFadeFactory.Builder |
setCrossFadeEnabled(boolean isCrossFadeEnabled)
Enables or disables animating the alpha of the
Drawable the cross fade will animate
from. |
DrawableCrossFadeFactory.Builder |
setDefaultAnimation(Animation animation)
|
DrawableCrossFadeFactory.Builder |
setDefaultAnimationFactory(ViewAnimationFactory<Drawable> factory)
Sets the
ViewAnimationFactory to use to generate animations to animate when no
previous Drawable is available to animate from. |
DrawableCrossFadeFactory.Builder |
setDefaultAnimationId(int animationId)
|
public Builder()
public Builder(int durationMillis)
durationMillis
- The duration of both the default animation when no previous Drawable
is present and the cross fade animation when a previous Drawable is present. This value
will not be used by the default animation if setDefaultAnimationId(int)
,
setDefaultAnimation(Animation)
, or
setDefaultAnimationFactory(ViewAnimationFactory)
is called.public DrawableCrossFadeFactory.Builder setCrossFadeEnabled(boolean isCrossFadeEnabled)
Drawable
the cross fade will animate
from.
Defaults to false
.
isCrossFadeEnabled
- If true
the previous Drawable
's alpha will be
animated from 100 to 0 while the new Drawable
's alpha is
animated from 0 to 100. Otherwise the previous Drawable
's
alpha will remain at 100 throughout the animation. See
TransitionDrawable.setCrossFadeEnabled(boolean)
public DrawableCrossFadeFactory.Builder setDefaultAnimationId(int animationId)
public DrawableCrossFadeFactory.Builder setDefaultAnimation(Animation animation)
public DrawableCrossFadeFactory.Builder setDefaultAnimationFactory(ViewAnimationFactory<Drawable> factory)
ViewAnimationFactory
to use to generate animations to animate when no
previous Drawable
is available to animate from.public DrawableCrossFadeFactory build()