# TimeTextDefaults

Artifact: [androidx.wear.compose:compose-material3](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material3/TimeText.kt+class:androidx.wear.compose.material3.TimeTextDefaults) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)


```
object TimeTextDefaults
```

<br />

*** ** * ** ***

Contains the default values used by `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#TimeText(androidx.compose.ui.Modifier,androidx.wear.compose.foundation.CurvedModifier,kotlin.Float,androidx.compose.ui.graphics.Color,androidx.wear.compose.material3.TimeSource,androidx.compose.foundation.layout.PaddingValues,kotlin.Function2)`.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeTextDefaults#backgroundColor()()` The recommended background color to use when displaying curved text so it is visible on top of other content. |
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeSource` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeTextDefaults#rememberTimeSource(kotlin.String)(timeFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Creates a default implementation of `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeSource` and remembers it. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeTextDefaults#timeFormat()()` Retrieves default timeFormat for the device. |
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/CurvedTextStyle` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeTextDefaults#timeTextStyle(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.TextUnit)(background: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, fontSize: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit)` Creates a `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/CurvedTextStyle` with default parameters used for showing time. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/PaddingValues` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeTextDefaults#ContentPadding()` The default content padding used by `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#TimeText(androidx.compose.ui.Modifier,androidx.wear.compose.foundation.CurvedModifier,kotlin.Float,androidx.compose.ui.graphics.Color,androidx.wear.compose.material3.TimeSource,androidx.compose.foundation.layout.PaddingValues,kotlin.Function2)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeTextDefaults#MaxSweepAngle()` The default maximum sweep angle in degrees used by `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#TimeText(androidx.compose.ui.Modifier,androidx.wear.compose.foundation.CurvedModifier,kotlin.Float,androidx.compose.ui.graphics.Color,androidx.wear.compose.material3.TimeSource,androidx.compose.foundation.layout.PaddingValues,kotlin.Function2)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeTextDefaults#TimeFormat12Hours()` Default format for 12h clock. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeTextDefaults#TimeFormat24Hours()` Default format for 24h clock. |

## Public functions

### backgroundColor

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
@Composable
fun backgroundColor(): Color
```

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

### rememberTimeSource

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

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

Creates a default implementation of `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeSource` and remembers it. Once the system time changes, it triggers an update of the `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeSource#currentTime()` which is formatted using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeTextDefaults#rememberTimeSource(kotlin.String)` param.

`https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/DefaultTimeSource` for Android uses `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TimeTextDefaults#rememberTimeSource(kotlin.String)` should follow the standard [Date and Time patterns](https://developer.android.com/reference/java/text/SimpleDateFormat#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](https://developer.android.com/reference/java/text/SimpleDateFormat#examples).

| Parameters |
|---|---|
| `timeFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Date and time string pattern. |

### timeFormat

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
@Composable
fun timeFormat(): String
```

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

### timeTextStyle

Added in [1.6.0-rc01](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.6.0-rc01)

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

Creates a `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/CurvedTextStyle` with default parameters used for showing time. By default a copy of MaterialTheme.typography.arcMedium style is created.

| Parameters |
|---|---|
| `background: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | The background color. |
| `color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = MaterialTheme.colorScheme.onBackground.setLuminance(80f)` | The main color. |
| `fontSize: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit = TextUnit.Unspecified` | The font size. |

## Public properties

### ContentPadding

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val ContentPadding: PaddingValues
```

The default content padding used by `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#TimeText(androidx.compose.ui.Modifier,androidx.wear.compose.foundation.CurvedModifier,kotlin.Float,androidx.compose.ui.graphics.Color,androidx.wear.compose.material3.TimeSource,androidx.compose.foundation.layout.PaddingValues,kotlin.Function2)`.

### MaxSweepAngle

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val MaxSweepAngle: Float
```

The default maximum sweep angle in degrees used by `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#TimeText(androidx.compose.ui.Modifier,androidx.wear.compose.foundation.CurvedModifier,kotlin.Float,androidx.compose.ui.graphics.Color,androidx.wear.compose.material3.TimeSource,androidx.compose.foundation.layout.PaddingValues,kotlin.Function2)`.

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.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val TimeFormat12Hours: String
```

Default format for 12h clock.

### TimeFormat24Hours

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val TimeFormat24Hours: String
```

Default format for 24h clock.