object TimeTextDefaults


Contains the default values used by TimeText.

Summary

Constants

const Float

The default maximum sweep angle in degrees used by TimeText.

const String

Default format for 12h clock.

const String

Default format for 24h clock.

Public functions

TimeSource

Creates a default implementation of TimeSource and remembers it.

String

Retrieves default timeFormat for the device.

TextStyle
@Composable
timeTextStyle(background: Color, color: Color, fontSize: TextUnit)

Creates a TextStyle with default parameters used for showing time on square screens.

Public properties

Float

Weight value used to specify that the value is automatic.

PaddingValues

The default content padding used by TimeText.

Constants

MaxSweepAngle

Added in 1.0.0-alpha30
const val MaxSweepAngle = 70.0f: Float

The default maximum sweep angle in degrees used by TimeText.

This is calculated by keeping the length of the corresponding chord on the circle to be approximately 57% of the screen width.

TimeFormat12Hours

Added in 1.0.0-alpha30
const val TimeFormat12HoursString

Default format for 12h clock.

TimeFormat24Hours

Added in 1.0.0-alpha30
const val TimeFormat24HoursString

Default format for 24h clock.

Public functions

rememberTimeSource

Added in 1.0.0-alpha30
@Composable
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 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: String

Date and time string pattern.

timeFormat

Added in 1.0.0-alpha30
@Composable
fun timeFormat(): String

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

timeTextStyle

@Composable
fun timeTextStyle(
    background: Color = Color.Unspecified,
    color: Color = MaterialTheme.colorScheme.onBackground,
    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.arcMedium style is created.

Parameters
background: Color = Color.Unspecified

The background color.

color: Color = MaterialTheme.colorScheme.onBackground

The main color.

fontSize: TextUnit = TextUnit.Unspecified

The font size.

Public properties

AutoTextWeight

Added in 1.0.0-alpha30
val AutoTextWeightFloat

Weight value used to specify that the value is automatic. It will be 1f when there is one text, and no weight will be used if there are 2 or more texts. For the 2+ texts case, usually one of them should have weight manually specified to ensure its properly cut and ellipsized.

ContentPadding

Added in 1.0.0-alpha30
val ContentPaddingPaddingValues

The default content padding used by TimeText.