:core:ui

Purpose: Everything shared across screens — the UiState/StatefulComposable state pattern, the Jetpack* design-system components, JetpackTheme, and Compose/Activity extensions.

Key APIs

APIWhat it doesCanonical doc
UiState<T>, StatefulComposable, updateState/updateStateWith/updateWithLoading/data/error wrapper every screen uses, and its update functionsState Management
Jetpack* components (components/)The design-system wrappers around Material 3Components
JetpackThemeMaterialExpressiveTheme-based theme, dynamic color + fallbackComponents § Theming
UiTextType-safe text (string vs. @StringRes) so ViewModels don't need ContextText and validation
checkForPermissions, getActivity()Permission helpers (extensions/ActivityExtensions.kt); getActivity() is a Context extension in :core:androidPermissions

Shared preview annotations and their combinations are covered in Previews.

Gotchas

  • A raw Material 3 composable that has a Jetpack* equivalent (e.g. Button, TextField, TopAppBar) is reported by Android lint — DesignSystemDetector (:lint) is an ERROR-severity check, lintPublished into every module that depends on core:ui.

  • Destination Screen composables obtain the ViewModel and collect its state. Preview/test their presentational children with data and callbacks; see the feature guide.

  • Async update helpers handle returned Result failures; they do not convert thrown exceptions into state errors. Their loading guard is not an atomic concurrency lock. Event consumption does not guarantee snackbar delivery. See the state guide before reusing these helpers.

Related Documentation

Packages

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard