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

Multi-preview annotation for testing Composables across various device sizes.

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

Multi-preview annotation for testing Composables in light and dark themes.

Link copied to clipboard

Represents different action types that can be attached to a Snackbar message.

Link copied to clipboard

Activity result contract for capturing photos with the camera.

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

Represents the state of a text input field with optional validation error.

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

Wrapper class representing the complete state of a UI screen.

Link copied to clipboard
sealed class UiText

Represents text that can be either a string resource (localized) or a dynamic string (runtime).

Functions

Link copied to clipboard

Returns the user's currently preferred application locale.

Link copied to clipboard
fun setLanguagePreference(languageCode: String)

Sets the application locale based on a language code.

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

A centralized composable wrapper that handles loading states, error handling, and content display.

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

Updates the UI state synchronously without showing loading indicators or handling errors.

Link copied to clipboard
context(viewModel: ViewModel)
inline fun <T : Any> MutableStateFlow<UiState<T>>.updateStateWith(crossinline operation: suspend T.() -> Result<T>)

Updates the UI state with the result of an async operation that returns new data.

Link copied to clipboard
context(viewModel: ViewModel)
inline fun <T : Any> MutableStateFlow<UiState<T>>.updateWith(crossinline operation: suspend T.() -> Result<Unit>)

Updates the UI state with the result of an async operation that performs an action without returning new data.