RemoteTimeText

Functions summary

Unit
@RemoteComposable
@Composable
RemoteTimeText(
    modifier: RemoteModifier,
    time: RemoteString,
    fontSize: RemoteTextUnit?,
    fontFamily: RemoteFontFamily?,
    leadingText: RemoteString?,
    trailingText: RemoteString?,
    separator: RemoteString,
    color: RemoteColor?,
    backgroundColor: RemoteColor,
    style: RemoteTextStyle,
    fontFeatureSettings: String?,
    fontVariationSettings: FontVariation.Settings?
)

Displays the current time and optional surrounding status text curved along the top of a circular screen.

Functions

@RemoteComposable
@Composable
fun RemoteTimeText(
    modifier: RemoteModifier = RemoteModifier,
    time: RemoteString = RemoteTimeDefaults.defaultTimeString(),
    fontSize: RemoteTextUnit? = null,
    fontFamily: RemoteFontFamily? = null,
    leadingText: RemoteString? = null,
    trailingText: RemoteString? = null,
    separator: RemoteString = "·".rs,
    color: RemoteColor? = null,
    backgroundColor: RemoteColor = RemoteTimeTextDefaults.backgroundColor,
    style: RemoteTextStyle = RemoteTimeTextDefaults.TimeTextStyle,
    fontFeatureSettings: String? = null,
    fontVariationSettings: FontVariation.Settings? = null
): Unit

Displays the current time and optional surrounding status text curved along the top of a circular screen.

RemoteTimeText is typically placed at the top of the screen and is the remote equivalent of androidx.wear.compose.material3.TimeText.

Commonly used properties from RemoteTextStyle are also exposed directly as parameters: when non-null, a styling parameter overrides the corresponding property in style; when null, the value from style is used instead.

Example of displaying the current time at the top of a circular screen:

import androidx.wear.compose.remote.material3.RemoteTimeText

RemoteTimeText(modifier = modifier)

Example of displaying RemoteTimeText with leading status text:

import androidx.compose.remote.creation.compose.state.rs
import androidx.wear.compose.remote.material3.RemoteTimeText

RemoteTimeText(
    modifier = modifier,
    leadingText = "ETA 12 min".rs,
)
Parameters
modifier: RemoteModifier = RemoteModifier

The RemoteModifier to be applied to the RemoteTimeText.

time: RemoteString = RemoteTimeDefaults.defaultTimeString()

The text to display as the time. Defaults to a formatted time string from the remote context.

fontSize: RemoteTextUnit? = null

The size of glyphs to use when painting the text. If null, uses RemoteTextStyle.fontSize from style, or 14.sp if also null in style.

fontFamily: RemoteFontFamily? = null

The font family to be used when rendering the text. If null, uses RemoteTextStyle.fontFamily from style, or the default typeface if also null in style.

leadingText: RemoteString? = null

Text to be displayed before the time, or null if not present.

trailingText: RemoteString? = null

Text to be displayed after the time, or null if not present.

separator: RemoteString = "·".rs

The separator to be used between the leading/trailing text and the time. Defaults to "·".

color: RemoteColor? = null

The color of the text. If null, uses RemoteTextStyle.color from style, or RemoteColorScheme.onBackground from RemoteMaterialTheme.colorScheme with its luminance set to 80 (matching androidx.wear.compose.material3.TimeText) if also null in style.

backgroundColor: RemoteColor = RemoteTimeTextDefaults.backgroundColor

The color of the arc drawn behind the text, so it stays visible on top of other content. Defaults to RemoteTimeTextDefaults.backgroundColor.

style: RemoteTextStyle = RemoteTimeTextDefaults.TimeTextStyle

The RemoteTextStyle to be applied to the text. Defaults to RemoteTimeTextDefaults.TimeTextStyle.

fontFeatureSettings: String? = null

The OpenType font feature settings applied to the text. If null, uses RemoteTextStyle.fontFeatureSettings from style (which defaults to RemoteTimeTextDefaults.FontFeatureSettings), or applies no custom feature settings if also null in style.

fontVariationSettings: FontVariation.Settings? = null

The OpenType font variation settings applied to the text. If null, uses RemoteTextStyle.fontVariationSettings from style (which defaults to RemoteTimeTextDefaults.FontVariationSettings), or applies no custom variation settings if also null in style.