UiText

sealed class UiText(source)

Text that remains unresolved until rendering, allowing state holders to supply literal text, string resources, or plural resources without retaining a Context.

Inheritors

Types

Link copied to clipboard
data class DynamicString(val content: String) : UiText
Link copied to clipboard
data class PluralResource(val resourceId: Int, val count: Int, val arguments: List<Any> = emptyList()) : UiText

A plural resource whose count selects the quantity. Include count in arguments as well if the text displays it.

Link copied to clipboard
data class StringResource(val resourceId: Int, val arguments: List<Any> = emptyList()) : UiText

Functions

Link copied to clipboard

Resolves text against the current composition configuration, including locale changes.

fun asString(context: Context): String

Resolves text using the supplied context and its current resource configuration.