- CharacterListRoot: koinViewModel(), ObserveAsEvents, forwards nav + shows snackbar via Context asString. - CharacterListScreen: pure state+onAction; AppScaffold + LazyColumn (key=id), design-system NetworkImage (contentDescription)/AppCard, loading/error/empty states, snapshot-based scroll-to-end -> OnLoadNextPage (ViewModel guards duplicates). - Loaded + error previews wrapped in AppTheme. - feature:characters:presentation now exposes kotlinx-immutable as api (ImmutableList is in the state API).
25 lines
1.0 KiB
Kotlin
25 lines
1.0 KiB
Kotlin
plugins {
|
|
alias(libs.plugins.architecture.android.library)
|
|
alias(libs.plugins.architecture.koin)
|
|
}
|
|
|
|
// UI-agnostic presentation: the MVI ViewModel + State/Action/Event live here and are shared by
|
|
// BOTH the Compose and the Views renderers. No Compose, no Views dependencies on purpose.
|
|
android {
|
|
namespace = "com.example.architecture.feature.characters.presentation"
|
|
}
|
|
|
|
dependencies {
|
|
implementation(project(":core:domain"))
|
|
implementation(project(":core:presentation"))
|
|
implementation(project(":feature:characters:domain"))
|
|
|
|
implementation(libs.androidx.lifecycle.viewmodel.ktx)
|
|
implementation(libs.androidx.lifecycle.viewmodel.savedstate)
|
|
implementation(libs.kotlinx.coroutines.android)
|
|
// Stable collection for state — makes the list Compose-stable WITHOUT a Compose dependency,
|
|
// so this module stays UI-agnostic (no @Stable annotation, which would require compose-runtime).
|
|
// `api` because CharacterListState.characters exposes ImmutableList in the public state API.
|
|
api(libs.kotlinx.collections.immutable)
|
|
}
|