Package-level declarations

Types

Link copied to clipboard
@Preview(name = "phone", device = "spec:width=360dp,height=640dp,dpi=480")
@Preview(name = "landscape", device = "spec:width=640dp,height=360dp,dpi=480")
@Preview(name = "foldable", device = "spec:width=673dp,height=841dp,dpi=480")
@Preview(name = "tablet", device = "spec:width=1280dp,height=800dp,dpi=480")
annotation class PreviewDevices

Multipreview annotation that represents various device sizes. Add this annotation to a composable to render various devices.

Link copied to clipboard
@Preview(uiMode = 16, name = "Light theme")
@Preview(uiMode = 32, name = "Dark theme")
annotation class PreviewThemes

Multi-preview annotation that represents light and dark themes. Add this annotation to a composable to render the both themes.

Link copied to clipboard

Enum class representing different actions that can be taken on a Snackbar.

Link copied to clipboard

Contract for taking picture.

Link copied to clipboard
data class TextFiledData(val value: String, val errorMessage: String? = null)

Data class representing the state of a text field.

Link copied to clipboard
data class UiState<T : Any>(val data: T, val loading: Boolean = false, val error: OneTimeEvent<Throwable?> = OneTimeEvent(null))

Data class representing the state of the UI.

Link copied to clipboard
sealed class UiText

A sealed class that represents a string that can be either a string resource or a dynamic string.

Functions

Link copied to clipboard

Returns the user's preferred locale.

Link copied to clipboard
fun setLanguagePreference(languageCode: String)

Sets the locale for the application based on the user's preferred language.

Link copied to clipboard
fun <T : Any> StatefulComposable(state: UiState<T>, onShowSnackbar: suspend (String, SnackbarAction, Throwable?) -> Boolean, content: @Composable (T) -> Unit)

A composable function that represents a stateful UI component.

Link copied to clipboard
inline fun <T : Any> MutableStateFlow<UiState<T>>.updateState(update: T.() -> T)

Extension function to update the state of a MutableStateFlow.

Link copied to clipboard
inline fun <T : Any> MutableStateFlow<UiState<T>>.updateStateWith(scope: CoroutineScope, crossinline operation: suspend T.() -> Result<T>)

Extension function to update the state of a MutableStateFlow with a suspend operation.

Link copied to clipboard
inline fun <T : Any> MutableStateFlow<UiState<T>>.updateWith(scope: CoroutineScope, crossinline operation: suspend T.() -> Result<Unit>)

Extension function to update the state of a MutableStateFlow with a suspend operation that returns Unit.