Start native apps faster with the Composables CLI ->
Object

TimeTextDefaults

Contains the default values used by TimeText

Source set: Android
public object TimeTextDefaults

Contains the default values used by TimeText

Properties

TimeFormat24Hours

Source set: Android
public const val TimeFormat24Hours: String = "HH:mm"

Default format for 24h clock.

TimeFormat12Hours

Source set: Android
public const val TimeFormat12Hours: String = "h:mm"

Default format for 12h clock.

ContentPadding

Source set: Android
public val ContentPadding: PaddingValues = PaddingValues(Padding)

The default content padding used by TimeText

Functions

timeFormat

Source set: Android
@Composable
    public fun timeFormat(): String

Retrieves default timeFormat for the device. Depending on settings, it can be either 12h or 24h format

timeTextStyle

Source set: Android
@Composable
    public fun timeTextStyle(
        background: Color = Color.Unspecified,
        color: Color = Color.Unspecified,
        fontSize: TextUnit = TextUnit.Unspecified,
    ): TextStyle

Creates a TextStyle with default parameters used for showing time on square screens. By default a copy of MaterialTheme.typography.caption1 style is created

Parameters

background The background color
color The main color
fontSize The font size

TextSeparator

Source set: Android
@Composable
    public fun TextSeparator(
        modifier: Modifier = Modifier,
        textStyle: TextStyle = timeTextStyle(),
        contentPadding: PaddingValues = PaddingValues(horizontal = 4.dp),
    )

A default implementation of Separator shown between start/end content and the time on square screens

Parameters

modifier A default modifier for the separator
textStyle A TextStyle for the separator
contentPadding The spacing values between the container and the separator

CurvedTextSeparator

Source set: Android
public fun CurvedScope.CurvedTextSeparator(
        curvedTextStyle: CurvedTextStyle? = null,
        contentArcPadding: ArcPaddingValues = ArcPaddingValues(angular = 4.dp),
    )

A default implementation of Separator shown between start/end content and the time on round screens

Parameters

curvedTextStyle A CurvedTextStyle for the separator
contentArcPadding A ArcPaddingValues for the separator text

timeSource

Source set: Android
public fun timeSource(timeFormat: String): TimeSource

A default implementation of TimeSource. Once the system time changes, it triggers an update of the TimeSource.currentTime which is formatted before that using timeFormat param.

Android implementation: DefaultTimeSource for Android uses android.text.format.DateFormat timeFormat should follow the standard Date and Time patterns Examples: "h:mm a" - 12:08 PM "yyyy.MM.dd HH:mm:ss" - 2021.11.01 14:08:56 More examples can be found here

Desktop implementation: TBD

Parameters

timeFormat Date and time string pattern