TimeTextDefaults

object TimeTextDefaults


Contains the default values used by TimeText

Summary

Constants

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 start/end content and the time on round screens

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

A default implementation of Separator shown between start/end content and the time on square 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

TimeFormat12Hours

Added in 1.0.0
const val TimeFormat12HoursString

Default format for 12h clock.

TimeFormat24Hours

Added in 1.0.0
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 start/end content and the time on round screens

Parameters
curvedTextStyle: CurvedTextStyle? = null

A CurvedTextStyle for the separator

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

A ArcPaddingValues for the separator text

TextSeparator

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

A default implementation of Separator shown between start/end content and the time on square 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
@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
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 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 = 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: Color = Color.Unspecified

The background color

color: Color = Color.Unspecified

The main color

fontSize: TextUnit = TextUnit.Unspecified

The font size

Public properties

ContentPadding

Added in 1.0.0
val ContentPaddingPaddingValues

The default content padding used by TimeText