TimeTextDefaults
object TimeTextDefaults
Contains the default values used by TimeText.
Summary
Public functions |
|
|---|---|
Color |
The recommended background color to use when displaying curved text so it is visible on top of other content. |
TimeSource |
@ComposableCreates a default implementation of |
String |
Retrieves default timeFormat for the device. |
CurvedTextStyle |
@ComposableCreates a |
Public properties |
|
|---|---|
PaddingValues |
The default content padding used by |
Float |
The default maximum sweep angle in degrees used by |
String |
Default format for 12h clock. |
String |
Default format for 24h clock. |
Public functions
backgroundColor
@Composable
fun backgroundColor(): Color
The recommended background color to use when displaying curved text so it is visible on top of other content.
rememberTimeSource
@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
@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.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.
Public properties
ContentPadding
val ContentPadding: PaddingValues
The default content padding used by TimeText.
MaxSweepAngle
val MaxSweepAngle: 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.