CrossfadeDrawable

class CrossfadeDrawable @JvmOverloads() constructor(start: Drawable?, end: Drawable?, scale: Scale, durationMillis: Int, fadeStart: Boolean, preferExactIntrinsicSize: Boolean) : Drawable, Drawable.Callback, Animatable2Compat

A Drawable that crossfades from start to end.

NOTE: The animation can only be executed once as the start drawable is dereferenced at the end of the transition.

Parameters

start

The Drawable to crossfade from.

end

The Drawable to crossfade to.

scale

The scaling algorithm for start and end.

durationMillis

The duration of the crossfade animation.

fadeStart

If false, the start drawable will not fade out while the end drawable fades in.

preferExactIntrinsicSize

If true, this drawable's intrinsic width/height will only be -1 if startandend return -1 for that dimension. If false, the intrinsic width/height will be -1 if startorend return -1 for that dimension. This is useful for views that require an exact intrinsic size to scale the drawable.

Constructors

CrossfadeDrawable
Link copied to clipboard
fun CrossfadeDrawable(start: Drawable?, end: Drawable?, scale: Scale = Scale.FIT, durationMillis: Int = DEFAULT_DURATION, fadeStart: Boolean = true, preferExactIntrinsicSize: Boolean = false)
The Drawable to crossfade from.

Types

Companion
Link copied to clipboard
object Companion

Functions

clearAnimationCallbacks
Link copied to clipboard
open override fun clearAnimationCallbacks(): <ERROR CLASS>
draw
Link copied to clipboard
open override fun draw(canvas: Canvas)
getAlpha
Link copied to clipboard
open override fun getAlpha(): Int
getColorFilter
Link copied to clipboard
open override fun getColorFilter(): ColorFilter?
getIntrinsicHeight
Link copied to clipboard
open override fun getIntrinsicHeight(): Int
getIntrinsicWidth
Link copied to clipboard
open override fun getIntrinsicWidth(): Int
invalidateDrawable
Link copied to clipboard
open override fun invalidateDrawable(who: Drawable)
isRunning
Link copied to clipboard
open override fun isRunning(): Boolean
registerAnimationCallback
Link copied to clipboard
open override fun registerAnimationCallback(callback: Animatable2Compat.AnimationCallback)
scheduleDrawable
Link copied to clipboard
open override fun scheduleDrawable(who: Drawable, what: Runnable, when: Long)
setAlpha
Link copied to clipboard
open override fun setAlpha(alpha: Int)
setColorFilter
Link copied to clipboard
open override fun setColorFilter(colorFilter: ColorFilter?)
setTint
Link copied to clipboard
open override fun setTint(tintColor: Int)
setTintBlendMode
Link copied to clipboard
@RequiresApi(value = 29)
open override fun setTintBlendMode(blendMode: BlendMode?)
setTintList
Link copied to clipboard
open override fun setTintList(tint: ColorStateList?)
setTintMode
Link copied to clipboard
open override fun setTintMode(tintMode: PorterDuff.Mode?)
start
Link copied to clipboard
open override fun start()
stop
Link copied to clipboard
open override fun stop()
unregisterAnimationCallback
Link copied to clipboard
open override fun unregisterAnimationCallback(callback: Animatable2Compat.AnimationCallback): Boolean
unscheduleDrawable
Link copied to clipboard
open override fun unscheduleDrawable(who: Drawable, what: Runnable)

Properties

durationMillis
Link copied to clipboard
val durationMillis: Int
The duration of the crossfade animation.
end
Link copied to clipboard
val end: Drawable?
fadeStart
Link copied to clipboard
val fadeStart: Boolean = true
If false, the start drawable will not fade out while the end drawable fades in.
preferExactIntrinsicSize
Link copied to clipboard
val preferExactIntrinsicSize: Boolean = false
If true, this drawable's intrinsic width/height will only be -1 if startandend return -1 for that dimension.
scale
Link copied to clipboard
val scale: Scale
The scaling algorithm for start and end.
start
Link copied to clipboard
var start: Drawable?