Composable Function

RemoteTimeText

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

RemoteTimeText

Source set: Android
@Composable
public 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,
)

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:

Example of displaying RemoteTimeText with leading status text:

Parameters

modifier The RemoteModifier to be applied to the RemoteTimeText.
time The text to display as the time. Defaults to a formatted time string from the remote context.
fontSize 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 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 Text to be displayed before the time, or null if not present.
trailingText Text to be displayed after the time, or null if not present.
separator The separator to be used between the leading/trailing text and the time. Defaults to "·".
color 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 The color of the arc drawn behind the text, so it stays visible on top of other content. Defaults to RemoteTimeTextDefaults.backgroundColor.
style The RemoteTextStyle to be applied to the text. Defaults to RemoteTimeTextDefaults.TimeTextStyle.
fontFeatureSettings 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 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.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: