:core:ui
Purpose: Everything shared across screens — the UiState/StatefulComposable state pattern, the Jetpack* design-system components, JetpackTheme, and Compose/Activity extensions.
Key APIs
| API | What it does | Canonical doc |
|---|---|---|
UiState<T>, StatefulComposable, updateState/updateStateWith/updateWith | Loading/data/error wrapper every screen uses, and its update functions | State Management |
Jetpack* components (components/) | The design-system wrappers around Material 3 | Components |
JetpackTheme | MaterialExpressiveTheme-based theme, dynamic color + fallback | Components § Theming |
UiText | Type-safe text (string vs. @StringRes) so ViewModels don't need Context | Text and validation |
checkForPermissions, getActivity() | Permission helpers (extensions/ActivityExtensions.kt); getActivity() is a Context extension in :core:android | Permissions |
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 oncore: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
Resultfailures; 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
State Management — the full
UiStatedeep diveComponents — component catalog, real usage, theming, lint enforcement
Architecture — where
core:uisits in the module graph