animateInCoroutine
Create a progress bar animation that runs in a coroutine.
Example
val animation = progressBarContextLayout<String> { ... }.animateInCoroutine(terminal, "context")
launch { animation.execute() }
animation.update { ... }
Parameters
The terminal to draw the progress bar to
The context to pass to the task
The total number of steps needed to complete the progress task, or null
if it is indeterminate.
The number of steps currently completed in the progress task.
If true
, start the task immediately.
If false
, the task will not be drawn to the screen.
If true
, the animation will be cleared when all tasks are finished. Otherwise, the animation will stop when all tasks are finished, but remain on the screen.
The duration over which to estimate the speed of the progress tasks. This estimate will be a rolling average over this duration.
The time source to use for the animation.
The widget maker to use to lay out the progress bars.
Create a progress bar animation for a single task that runs synchronously.
Example
val animation = progressBarLayout { ... }.animateInCoroutine(terminal)
launch { animation.execute() }
animation.update { ... }
Parameters
The terminal to draw the progress bar to
The total number of steps needed to complete the progress task, or null
if it is indeterminate.
The number of steps currently completed in the progress task.
If true
, start the task immediately.
If false
, the task will not be drawn to the screen.
If true
, the animation will be cleared when all tasks are finished. Otherwise, the animation will stop when all tasks are finished, but remain on the screen.
The duration over which to estimate the speed of the progress tasks. This estimate will be a rolling average over this duration.
The time source to use for the animation.
The widget maker to use to lay out the progress bars.
Create an animator that runs this animation in a coroutine.
Example
val animation = terminal.animation<Unit> { ... }.animateInCoroutine(terminal)
launch { animation.execute() }
Create an animator that runs this animation in a coroutine.
Example
val animator = animation.animateInCoroutine(terminal)
launch { animator.execute() }
Create an animator that runs this animation in a coroutine.
Example
val animator = animation.animateInCoroutine()
launch { animator.execute() }