Package-level declarations

Types

Link copied to clipboard
fun interface DistanceFormat

A functional interface for formatting distances in a user-friendly way. This interface provides a composable function that formats a distance value according to a specified unit and language.

Link copied to clipboard
fun interface DurationFormat

Formatter for converting Duration values into localized strings.

Link copied to clipboard
fun interface SpeedFormat

A functional interface for formatting Speed values into localized AnnotatedString representations.

Link copied to clipboard
fun interface TimeFormat

Functional interface for formatting a given time into a string representation based on a specific time format (12-hour or 24-hour).

Functions

Link copied to clipboard
fun DistanceText(distance: Distance, modifier: Modifier = Modifier, format: DistanceFormat = DistanceFormat.Short, locale: Locale = Locale.current, unit: DistanceUnit = distance.unitForLocale(locale), style: TextStyle = TextStyle.Default)

Displays a formatted distance as text, adapting to the specified locale, unit system, and format style.

fun DistanceText(distance: Distance, unit: DistanceUnit, language: String, modifier: Modifier = Modifier, format: DistanceFormat = DistanceFormat.Short, style: TextStyle = TextStyle.Default)

Displays a formatted distance as text, adapting to the specified language, unit system, and format style.

Link copied to clipboard
fun DurationText(duration: Duration, modifier: Modifier = Modifier, locale: Locale = Locale.current, format: DurationFormat = DurationFormat.short(), style: TextStyle = TextStyle.Default)

Element that displays Duration values in a human-readable format in a language matching a given Locale.

Link copied to clipboard

Formats the Distance into a long representation based on the specified DistanceUnit and language.

Formats the Speed into a long localized string representation based on the specified SpeedUnit and language.

Link copied to clipboard

Formats the Distance into a short representation based on the specified DistanceUnit and language.

Formats the Speed into a short localized string representation based on the specified SpeedUnit and language.

Link copied to clipboard
fun SpeedText(speed: Speed, modifier: Modifier = Modifier, maxLines: Int = 1, format: SpeedFormat = SpeedFormat.Short, locale: Locale = Locale.current, unit: SpeedUnit = speedUnitForLocale(locale), style: TextStyle = TextStyle.Default)

Displays a formatted speed as text, adapting to the specified locale, unit system, and format style.

fun SpeedText(speed: Speed, unit: SpeedUnit, language: String, modifier: Modifier = Modifier, maxLines: Int = 1, format: SpeedFormat = SpeedFormat.Short, style: TextStyle = TextStyle.Default)

Displays a formatted speed as text, with explicit control over unit and language.

Link copied to clipboard
fun TimeText(time: Date, modifier: Modifier = Modifier, showSeconds: Boolean = false, locale: Locale = Locale.current, format: TimeFormat = timeFormatForLocale(locale), style: TextStyle = TextStyle.Default)

A composable function to display formatted time as text.