CrossfadePainter

class CrossfadePainter(start: Painter?, val end: Painter?, val contentScale: ContentScale = ContentScale.Fit, val duration: Duration = 200.milliseconds, val timeSource: TimeSource = TimeSource.Monotonic, val fadeStart: Boolean = true, val preferExactIntrinsicSize: Boolean = false) : Painter

A Painter that crossfades from start to end.

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

Parameters

start

The Painter to crossfade from.

end

The Painter to crossfade to.

contentScale

The scaling algorithm for start and end.

duration

The duration of the crossfade animation.

timeSource

The source for measuring time intervals.

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 start and end return -1 for that dimension. If false, the intrinsic width/height will be -1 if start or end return -1 for that dimension. This is useful for views that require an exact intrinsic size to scale the drawable.

Constructors

Link copied to clipboard
constructor(start: Painter?, end: Painter?, contentScale: ContentScale = ContentScale.Fit, duration: Duration = 200.milliseconds, timeSource: TimeSource = TimeSource.Monotonic, fadeStart: Boolean = true, preferExactIntrinsicSize: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val end: Painter?
Link copied to clipboard
val fadeStart: Boolean = true
Link copied to clipboard
open override val intrinsicSize: Size
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard