Package-level declarations

Types

Link copied to clipboard
@Preview(name = "Font Scale 100%", group = "Accessibility", fontScale = 1.0, showBackground = true)
@Preview(name = "Font Scale 150%", group = "Accessibility", fontScale = 1.5, showBackground = true)
@Preview(name = "Font Scale 200%", group = "Accessibility", fontScale = 2.0, showBackground = true)
annotation class AccessibilityPreviews
Link copied to clipboard
annotation class AllPreviews

Composite MultiPreview combining device form factors, themes, and accessibility options.

Link copied to clipboard
@Preview(name = "Phone - Small", group = "Devices", device = "id:Nexus 5", showBackground = true)
@Preview(name = "Phone - Standard", group = "Devices", device = "id:pixel_7", showBackground = true)
@Preview(name = "Tablet - Portrait", group = "Devices", device = "spec:width=1280dp,height=800dp,dpi=240", showBackground = true)
@Preview(name = "Tablet - Landscape", group = "Devices", device = "spec:width=1280dp,height=800dp,orientation=landscape", showBackground = true)
annotation class DevicePreviews
Link copied to clipboard
@Preview(name = "Small Phone", group = "Devices", device = "id:Nexus 5", showBackground = true)
@Preview(name = "Standard Phone", group = "Devices", device = "id:pixel_7", showBackground = true)
@Preview(name = "Tablet Portrait", group = "Devices", device = "spec:width=1280dp,height=800dp,dpi=240", showBackground = true)
@Preview(name = "Tablet Landscape", group = "Devices", device = "spec:width=1280dp,height=800dp,orientation=landscape", showBackground = true)
@Preview(name = "Dark Mode", group = "Themes", device = "id:pixel_7", uiMode = 32, showBackground = true)
@Preview(name = "Large Font (150%)", group = "Accessibility", device = "id:pixel_7", fontScale = 1.5, showBackground = true)
@Preview(name = "RTL Layout", group = "Locales", device = "id:pixel_7", locale = "ar", showBackground = true)
annotation class MultiPreviews

MultiPreview annotation representing common device sizes, orientations, and configurations.

Link copied to clipboard
@Preview(name = "Light Mode", group = "Themes", uiMode = 16, showBackground = true)
@Preview(name = "Dark Mode", group = "Themes", uiMode = 32, showBackground = true)
annotation class ThemePreviews
Link copied to clipboard
sealed interface UiState<out T>

A generic sealed interface representing the different states of an asynchronous operation or data loading process. Annotated with @Immutable for Jetpack Compose stability and optimal recomposition behavior.

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Detects tap gestures and passes the click origin relative to the element's width and height.

Link copied to clipboard

Returns the encapsulated throwable if this state is UiState.Failure, or null otherwise.

Link copied to clipboard
fun Modifier.fadeOut(initialColor: Color = Color.Transparent, fadeToColor: Color = Color.White, verticalFade: Boolean = true): Modifier

Applies a linear gradient fade overlay across the content.

Link copied to clipboard

Traverses the ContextWrapper chain to find the underlying Activity.

Link copied to clipboard
inline fun <T : Activity> Context.findActivityOf(): T?

Traverses the ContextWrapper chain to find a specific subtype of Activity.

Link copied to clipboard

Attempts to find the Application instance associated with this Context.

Link copied to clipboard
inline fun <T, R> UiState<T>.flatMap(transform: (T) -> UiState<R>): UiState<R>

Transforms the UiState.Success data using the given transform function that returns a new UiState.

Link copied to clipboard
inline fun <T, R> UiState<T>.fold(onSuccess: (data: T) -> R, onFailure: (throwable: Throwable) -> R, onLoading: () -> R, onIdle: () -> R): R
Link copied to clipboard
fun <T> UiState<T>.getOrDefault(default: T): T

Returns the encapsulated data if this state is UiState.Success, or default otherwise.

Link copied to clipboard
inline fun <T> UiState<T>.getOrElse(onFailure: (throwable: Throwable?) -> T): T

Returns the encapsulated data if this state is UiState.Success, or the result of onFailure function for non-success states.

Link copied to clipboard
fun <T> UiState<T>.getOrNull(): T?

Returns the encapsulated data if this state is UiState.Success, or null otherwise.

Link copied to clipboard
fun <T> UiState<T>.getOrThrow(): T

Returns the encapsulated data if this state is UiState.Success, or throws the encapsulated Throwable if this state is UiState.Failure, or an IllegalStateException if UiState.Idle or UiState.Loading.

Link copied to clipboard
fun Modifier.glow(glowingColor: Color, containerColor: Color = Color.White, cornerRadius: Dp = 0.dp, glowingRadius: Dp = 20.dp, glowAlpha: Float = 0.8f, offsetX: Dp = 0.dp, offsetY: Dp = 0.dp): Modifier

Applies a glowing shadow effect around the composable surface.

Link copied to clipboard
inline fun Modifier.iif(condition: Boolean, then: Modifier.() -> Modifier): Modifier

Alias for thenIf. Applies the given then modifier builder if condition is true.

Link copied to clipboard
fun ImeScrollBox(modifier: Modifier = Modifier, scrollState: ScrollState = rememberScrollState(), verticalArrangement: Arrangement.Vertical = Arrangement.Bottom, horizontalAlignment: Alignment.Horizontal = Alignment.CenterHorizontally, enabled: Boolean = true, content: @Composable ColumnScope.() -> Unit)

A container that automatically adjusts its padding to accommodate the software keyboard (IME) and enables vertical scrolling.

Link copied to clipboard
fun Modifier.innerShadow(shape: Shape, color: Color = Color.Black, blur: Dp = 4.dp, offsetY: Dp = 2.dp, offsetX: Dp = 2.dp, spread: Dp = 0.dp): Modifier

Adds an inner shadow effect inside the content outline.

Link copied to clipboard
inline fun <T, R> UiState<T>.map(transform: (T) -> R): UiState<R>

Transforms the UiState.Success data using the given transform function. Non-success states (UiState.Idle, UiState.Loading, UiState.Failure) are passed through unchanged.

Link copied to clipboard
fun Modifier.parallaxLayout(scrollState: ScrollState, rate: Float = 2.0f): Modifier

Creates a parallax scrolling translation effect without re-measuring layout during scroll.

Link copied to clipboard

Creates and remembers a state that tracks whether the software keyboard (IME) is currently visible.

Link copied to clipboard

Traverses the ContextWrapper chain to find the underlying Activity.

Link copied to clipboard

Gets the Application instance associated with this Context.

Link copied to clipboard
fun Modifier.shadow(color: Color = Color.Black, offsetX: Dp = 0.dp, offsetY: Dp = 0.dp, blurRadius: Dp = 0.dp): Modifier

Draws a custom drop shadow behind the content using hardware-accelerated/canvas blur.

Link copied to clipboard
fun Modifier.shimmerEffect(baseColor: Color = Color(0xFFB8B5B5), highlightColor: Color = Color(0xFFE0E0E0), durationMillis: Int = 1000): Modifier

Applies an animated shimmer loading effect across the composable.

Link copied to clipboard
fun Context.showToast(@StringRes msgRes: Int, duration: Int = Toast.LENGTH_SHORT)

Displays a toast message using a string resource ID.

fun Context.showToast(msg: String, duration: Int = Toast.LENGTH_SHORT)

Displays a toast message.

Link copied to clipboard
fun Modifier.spreadShadow(spread: Dp = 8.dp, @FloatRange(from = 0.0, to = 1.0) alpha: Float = 0.25f, color: Color = Color.Gray, radius: Dp = 8.dp): Modifier

Creates a layered spread shadow effect around the composable using repeated border steps.

Link copied to clipboard
inline fun Modifier.thenIf(condition: Boolean, block: Modifier.() -> Modifier): Modifier

Applies a Modifier if the given condition is true.