sealed class TimeTextScope


Receiver scope which is used by TimeText.

Summary

Protected constructors

Public functions

abstract Unit
composable(content: @Composable () -> Unit)

Adds a composable in content of TimeText.

abstract Unit

Adds a separator in TimeText.

abstract Unit
text(text: String, style: TextStyle?, weight: Float)

Adds a composable Text for non-round devices and curvedText for round devices to TimeText content.

abstract Unit

Adds a text displaying current time.

Protected constructors

TimeTextScope

protected TimeTextScope()

Public functions

composable

Added in 1.0.0-alpha30
abstract fun composable(content: @Composable () -> Unit): Unit

Adds a composable in content of TimeText. This can be used to display non-text information such as an icon.

Parameters
content: @Composable () -> Unit

Slot for the composable to be displayed.

separator

Added in 1.0.0-alpha30
abstract fun separator(style: TextStyle? = null): Unit

Adds a separator in TimeText.

Parameters
style: TextStyle? = null

configuration for the separator such as color, font etc.

text

Added in 1.0.0-alpha30
abstract fun text(
    text: String,
    style: TextStyle? = null,
    weight: Float = TimeTextDefaults.AutoTextWeight
): Unit

Adds a composable Text for non-round devices and curvedText for round devices to TimeText content. Typically used to add a short status message ahead of the time text.

Parameters
text: String

The text to display.

style: TextStyle? = null

configuration for the text such as color, font etc.

weight: Float = TimeTextDefaults.AutoTextWeight

Size the text's width proportional to its weight relative to other weighted sibling elements in the TimeText. Specify NaN to make this text not have a weight specified. The default value, TimeTextDefaults.AutoTextWeight, makes this text have weight 1f if it's the only one, and not have weight if there are two or more.

time

Added in 1.0.0-alpha30
abstract fun time(): Unit

Adds a text displaying current time.