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

Unit
CurvedScope.CurvedTextSeparator(
    curvedTextStyle: CurvedTextStyle?,
    contentArcPadding: ArcPaddingValues
)

A default implementation of Separator shown between any text/composable and the time on round screens.

Unit
@Composable
TextSeparator(
    modifier: Modifier,
    textStyle: TextStyle,
    contentPadding: PaddingValues
)

A default implementation of Separator shown between any text/composable and the time on non-round screens.

String

Retrieves default timeFormat for the device.

TimeSource
timeSource(timeFormat: String)

A default implementation of TimeSource.

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

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

Public properties

PaddingValues

The default content padding used by TimeText.

Constants

MaxSweepAngle

Added in 1.0.0-alpha24
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-alpha24
const val TimeFormat12HoursString

Default format for 12h clock.

TimeFormat24Hours

Added in 1.0.0-alpha24
const val TimeFormat24HoursString

Default format for 24h clock.

Public functions

CurvedTextSeparator

fun CurvedScope.CurvedTextSeparator(
    curvedTextStyle: CurvedTextStyle? = null,
    contentArcPadding: ArcPaddingValues = ArcPaddingValues(angular = 4.dp)
): Unit

A default implementation of Separator shown between any text/composable and the time on round screens.

Parameters
curvedTextStyle: CurvedTextStyle? = null

A CurvedTextStyle for the separator.

contentArcPadding: ArcPaddingValues = ArcPaddingValues(angular = 4.dp)

ArcPaddingValues for the separator text.

TextSeparator

Added in 1.0.0-alpha24
@Composable
fun TextSeparator(
    modifier: Modifier = Modifier,
    textStyle: TextStyle = timeTextStyle(),
    contentPadding: PaddingValues = PaddingValues(horizontal = 4.dp)
): Unit

A default implementation of Separator shown between any text/composable and the time on non-round screens.

Parameters
modifier: Modifier = Modifier

A default modifier for the separator.

textStyle: TextStyle = timeTextStyle()

A TextStyle for the separator.

contentPadding: PaddingValues = PaddingValues(horizontal = 4.dp)

The spacing values between the container and the separator.

timeFormat

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

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

timeSource

Added in 1.0.0-alpha24
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 using timeFormat param.

Android implementation: 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.

Desktop implementation: TBD.

Parameters
timeFormat: String

Date and time string pattern.

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.labelSmall 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

ContentPadding

Added in 1.0.0-alpha24
val ContentPaddingPaddingValues

The default content padding used by TimeText.