kyrie / com.github.alexjlockwood.kyrie / KyrieDrawable

KyrieDrawable

class KyrieDrawable : Drawable, Animatable

An animatable drawable based on scalable vector graphics.

Types

Builder

class Builder

Builder class used to create a KyrieDrawable.

Listener

interface Listener

A listener that receives notifications from an animation. Notifications indicate animation related events, such as the start or end of the animation.

ListenerAdapter

abstract class ListenerAdapter : KyrieDrawable.Listener

This adapter class provides empty implementations of the methods from Listener. Any custom listener that cares only about a subset of the methods of this listener can simply subclass this adapter class instead of implementing the interface directly.

Properties

currentPlayTime

var currentPlayTime: Long

Sets the position of the animation to the specified point in time. This time should be between 0 and the total duration of the animation, including any repetition.

isPaused

val isPaused: Boolean

Returns true if the animation has been paused.

isStarted

val isStarted: Boolean

Returns true if the animation has been started.

totalDuration

val totalDuration: Long

Gets the total duration of the animation, accounting for start delay and repeating. Return Animation.INFINITE if the duration is infinite.

Functions

addListener

fun addListener(listener: KyrieDrawable.Listener): Unit

Adds a Listener to this KyrieDrawable's set of listeners.

clearListeners

fun clearListeners(): Unit

Removes all Listeners from this KyrieDrawable's set of listeners.

draw

fun draw(canvas: Canvas): Unit

getAlpha

fun getAlpha(): Int

getColorFilter

fun getColorFilter(): ColorFilter?

getIntrinsicHeight

fun getIntrinsicHeight(): Int

getIntrinsicWidth

fun getIntrinsicWidth(): Int

getOpacity

fun getOpacity(): Int

isAutoMirrored

fun isAutoMirrored(): Boolean

isRunning

fun isRunning(): Boolean

Returns true if the animation is running.

isStateful

fun isStateful(): Boolean

onStateChange

fun onStateChange(stateSet: IntArray): Boolean

pause

fun pause(): Unit

Pauses the animation.

removeListener

fun removeListener(listener: KyrieDrawable.Listener): Unit

Removes a Listener from this KyrieDrawable's set of listeners.

resume

fun resume(): Unit

Resumes the animation.

setAlpha

fun setAlpha(alpha: Int): Unit

setAutoMirrored

fun setAutoMirrored(mirrored: Boolean): Unit

setColorFilter

fun setColorFilter(colorFilter: ColorFilter?): Unit

setTint

fun setTint(tint: Int): Unit

setTintList

fun setTintList(tintList: ColorStateList?): Unit

setTintMode

fun setTintMode(tintMode: Mode): Unit

start

fun start(): Unit

Starts the animation.

stop

fun stop(): Unit

Stops the animation. If the animation is running, it will be canceled.

Companion Object Functions

builder

fun builder(): KyrieDrawable.Builder

Constructs a new KyrieDrawable.Builder.

create

fun create(context: Context, resId: Int): KyrieDrawable?

Creates a KyrieDrawable from an existing VectorDrawable or AnimatedVectorDrawable XML file.