arch-android
1.2.0indexedErgonomic toolkit for app architecture: state machines for view/scene orchestration, storage abstractions with persisted delegates, recycler utilities, foldable posture helpers and a lightweight context provider.
Ergonomic toolkit for app architecture: state machines for view/scene orchestration, storage abstractions with persisted delegates, recycler utilities, foldable posture helpers and a lightweight context provider.
A Kotlin-first Android toolkit with APIs designed for Android source sets in KMP projects.
Use this toolkit in Android UI/source sets. Keep Views screens on Views; Compose screens can render their own state and lists. For preferences shared across KMP targets, evaluate Arch Storage. See the consumer guide for ownership and concrete storage criteria.
kotlin {
sourceSets {
androidMain.dependencies {
implementation("io.github.matheus-corregiari:arch-android:<latest-version>")
}
}
}
For an Android-only project:
dependencies {
implementation("io.github.matheus-corregiari:arch-android:<latest-version>")
}
AndroidX Startup initializes storage and the context provider through the merged manifest. If your app disables those initializers, initialize the needed features once from the application:
class App : Application() {
override fun onCreate() {
super.onCreate()
Storage.KeyValue.init(this)
ContextProvider.init(this)
}
}
Create a view state machine:
val machine = ViewStateMachine()
machine.setup {
state(0) {
visibles(viewA)
gones(viewB)
}
state(1) {
visibles(viewB)
gones(viewA)
}
}
machine.changeState(0)
Persist a typed value:
val darkMode = ConfigValue(
name = "dark_mode",
default = false,
storage = { Storage.KeyValue.regular },
)
darkMode.set(true)
val enabled = darkMode.get()
| Target | Support |
|---|---|
| Android | Supported from minSdk 20 |
| Tool | Version |
|---|---|
| Kotlin | 2.4.20 |
| Gradle |
Project guides and API documentation are published through GitHub Pages. Start with the consumer guide and tested recipes for lifecycle, state, lists and preferences. See CONTRIBUTING for the local workflow.
Licensed under the Apache License 2.0. See LICENSE.
See release notes, dependency versions and coverage configuration. This release is a candidate until tagged and published.
2.4.209.8.021 via the Gradle toolchainminSdk 20 and compileSdk 37.29.4.1 and Build Tools 37.0.0 for building the repositorytargetSdk is selected by the consuming app9.8.0| Java | 21 |
Surfaced from shared tags and platforms — no rankings paid for.