ThreadProgressTaskAnimator

Properties

Link copied to clipboard
abstract val completed: Long

The number of units of work that have been completed

Link copied to clipboard
abstract val context: T

The context is used to pass custom information to the task

Link copied to clipboard
abstract val finished: Boolean

true if this animation has finished and should be stopped or cleared.

Link copied to clipboard
open val fps: Int

The rate, in Hz, that this animation should be refreshed, or 0 if it should not be refreshed automatically.

Link copied to clipboard
abstract val id: TaskId

The unique id of this task

Link copied to clipboard
abstract val paused: Boolean

Whether the task is currently paused

Link copied to clipboard

The time between refreshes. This is 1 / refreshRate

Link copied to clipboard
abstract val started: Boolean

Whether the task has been started

Link copied to clipboard
abstract val total: Long?

The total number of units of work, or null if the total is unknown

Link copied to clipboard
abstract val visible: Boolean

Whether the task should be visible in the progress bar

Functions

Link copied to clipboard
fun ProgressTask<*>.advance(amount: Long = 1)
fun ProgressTask<*>.advance(amount: Number)

Advance the completed progress of this task by amount.

Link copied to clipboard

Create an animator that runs this animation synchronously.

Link copied to clipboard
abstract override fun clear()

Stop this animation and remove it from the screen.

Link copied to clipboard
fun BlockingAnimator.execute(executor: ExecutorService = Executors.newSingleThreadExecutor(DaemonThreadFactory())): Future<*>

Run the animation in a background thread on an executor.

Link copied to clipboard
abstract fun makeState(): ProgressState<T>

Create a ProgressState for this task's current state

Link copied to clipboard
abstract fun refresh(refreshAll: Boolean = false)

Draw the animation to the screen.

Link copied to clipboard
abstract fun reset(start: Boolean = true, block: ProgressTaskUpdateScope<T>.() -> Unit = {})

Reset the task so its completed count is 0 and its clock is reset.

Link copied to clipboard
abstract fun runBlocking()

Start the animation and refresh it until all its tasks are finished.

Link copied to clipboard
abstract override fun stop()

Stop this animation without removing it from the screen.

Link copied to clipboard
abstract fun update(block: ProgressTaskUpdateScope<T>.() -> Unit)

Update the task's state.

Link copied to clipboard
fun ProgressTask<*>.update(completed: Long)
fun ProgressTask<*>.update(completed: Number)

Set the completed progress of this task to completed.