ProgressBar

A horizontal bar that tracks progress.

The bar has three states:

  • indeterminate: the bar will draw its full width and show a pulsing animation based on pulsePosition

  • in progress: the bar will draw a width proportional to fractionComplete, or completed / total

  • finished: the bar will draw its full width with no pulse.

Constructors

Link copied to clipboard
constructor(total: Long = 100, completed: Long = 0, indeterminate: Boolean = false, width: Int? = null, pulsePosition: Float = 0.0f, showPulse: Boolean? = null, pendingChar: String? = null, separatorChar: String? = null, completeChar: String? = null, pendingStyle: TextStyle? = null, separatorStyle: TextStyle? = null, completeStyle: TextStyle? = null, finishedStyle: TextStyle? = null, indeterminateStyle: TextStyle? = null)
constructor(fractionComplete: Float = 0.0f, indeterminate: Boolean = false, width: Int? = null, pulsePosition: Float = 0.0f, showPulse: Boolean? = null, pendingChar: String? = null, separatorChar: String? = null, completeChar: String? = null, pendingStyle: TextStyle? = null, separatorStyle: TextStyle? = null, completeStyle: TextStyle? = null, finishedStyle: TextStyle? = null, indeterminateStyle: TextStyle? = null)

Functions

Link copied to clipboard
open override fun measure(t: Terminal, width: Int): WidthRange
Link copied to clipboard
open override fun render(t: Terminal, width: Int): Lines
Link copied to clipboard
fun Widget.withPadding(padding: Padding, padEmptyLines: Boolean = true): Widget

Add padding around this widget.

fun Widget.withPadding(padEmptyLines: Boolean = true, padding: Padding.Builder.() -> Unit): Widget
fun Widget.withPadding(all: Int, padEmptyLines: Boolean = true): Widget
fun Widget.withPadding(top: Int, right: Int, bottom: Int, left: Int, padEmptyLines: Boolean = true): Widget