ProgressLayoutBuilder

class ProgressLayoutBuilder<T>(val textFps: Int = TEXT_FPS, val animationFps: Int = ANIMATION_FPS, val align: TextAlign = TextAlign.RIGHT, val verticalAlign: VerticalAlign = VerticalAlign.BOTTOM) : ProgressLayoutScope<T>

A builder for creating a progress bar layout.

If you don't want to use the progressBarLayout DSL, you can use this builder instead, and call build when you're done adding cells.

Constructors

Link copied to clipboard
constructor(textFps: Int = TEXT_FPS, animationFps: Int = ANIMATION_FPS, align: TextAlign = TextAlign.RIGHT, verticalAlign: VerticalAlign = VerticalAlign.BOTTOM)

Properties

Link copied to clipboard
open override val align: TextAlign

The default horizontal alignment for cells

Link copied to clipboard
open override val animationFps: Int

The default framerate for animation cells

Link copied to clipboard
open override val textFps: Int

The default framerate for text based cells

Link copied to clipboard
open override val verticalAlign: VerticalAlign

The default vertical alignment for cells

Functions

Link copied to clipboard
fun build(spacing: Int = 2, alignColumns: Boolean = true): ProgressBarDefinition<T>

Build the progress bar layout.

Link copied to clipboard
open override fun cell(width: ColumnWidth, fps: Int, align: TextAlign?, verticalAlign: VerticalAlign?, content: ProgressState<T>.() -> Widget)

Add a cell to this layout.

Link copied to clipboard
fun ProgressLayoutScope<*>.completed(suffix: String = "", includeTotal: Boolean = true, precision: Int = 1, style: TextStyle = DEFAULT_STYLE, verticalAlign: VerticalAlign = this.verticalAlign, fps: Int = textFps)

Add a cell that displays the current completed count to this layout.

Link copied to clipboard
fun ProgressLayoutScope<*>.marquee(content: String, width: Int, fps: Int = 3, align: TextAlign = this.align, verticalAlign: VerticalAlign = this.verticalAlign, scrollWhenContentFits: Boolean = false)
fun <T> ProgressLayoutScope<T>.marquee(width: Int, fps: Int = 3, align: TextAlign = this.align, verticalAlign: VerticalAlign = this.verticalAlign, scrollWhenContentFits: Boolean = false, content: ProgressState<T>.() -> String)

Add a fixed width text cell that scrolls its contents horizontally so that long text can be displayed in a fixed width.

Link copied to clipboard
fun ProgressLayoutScope<*>.percentage(fps: Int = textFps, style: TextStyle = DEFAULT_STYLE, verticalAlign: VerticalAlign = this.verticalAlign)

Add a cell that displays the current percentage to this layout.

Link copied to clipboard
fun ProgressLayoutScope<*>.progressBar(width: Int? = 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, pulsePeriod: Duration = 2.seconds, verticalAlign: VerticalAlign = this.verticalAlign, fps: Int = animationFps)

Add a progress bar cell to this layout.

Link copied to clipboard
fun ProgressLayoutScope<*>.speed(suffix: String = "/s", style: TextStyle = DEFAULT_STYLE, verticalAlign: VerticalAlign = this.verticalAlign, fps: Int = textFps)

Add a cell that displays the current speed to this layout.

Link copied to clipboard
fun ProgressLayoutScope<*>.spinner(spinner: Spinner, verticalAlign: VerticalAlign = this.verticalAlign, fps: Int = 8)

Add a Spinner to this layout.

Link copied to clipboard
fun ProgressLayoutScope<*>.text(content: String, align: TextAlign = this.align, verticalAlign: VerticalAlign = this.verticalAlign)

Add a fixed text cell to this layout.

fun <T> ProgressLayoutScope<T>.text(align: TextAlign = this.align, verticalAlign: VerticalAlign = this.verticalAlign, fps: Int = textFps, content: ProgressState<T>.() -> String)

Add a dynamic text cell to this layout.

Link copied to clipboard
fun ProgressLayoutScope<*>.timeElapsed(compact: Boolean = false, style: TextStyle = DEFAULT_STYLE, verticalAlign: VerticalAlign = this.verticalAlign, fps: Int = textFps)

Add a cell that displays the elapsed time to this layout.

Link copied to clipboard
fun ProgressLayoutScope<*>.timeRemaining(prefix: String = "eta ", compact: Boolean = false, elapsedWhenFinished: Boolean = false, elapsedPrefix: String = " in ", style: TextStyle = DEFAULT_STYLE, verticalAlign: VerticalAlign = this.verticalAlign, fps: Int = textFps)

Add a cell that displays the time remaining to this layout.