Object

TimeTextDefaults

Contains the default values used by TimeText.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Android
public object TimeTextDefaults

Contains the default values used by TimeText.

Functions

timeFormat

@Composable
public fun timeFormat(): String

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


timeTextStyle

@Composable
public fun timeTextStyle(
    background: Color = Color.Unspecified,
    color: Color = MaterialTheme.colorScheme.onBackground.setLuminance(80f),
    fontSize: TextUnit = TextUnit.Unspecified,
): CurvedTextStyle

Creates a CurvedTextStyle with default parameters used for showing time. By default a copy of MaterialTheme.typography.arcMedium style is created.

Parameters

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

rememberTimeSource

@Composable
public fun rememberTimeSource(timeFormat: String): TimeSource

Creates a default implementation of TimeSource and remembers it. Once the system time changes, it triggers an update of the TimeSource.currentTime which is formatted using timeFormat param.

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.

Parameters

timeFormat Date and time string pattern.
@Composable public fun backgroundColor(): Color

The recommended background color to use when displaying curved text so it is visible on top of other content.