Arch Android Toolkit
A Kotlin-first Android toolkit with APIs designed for Android source sets in KMP projects.

Features
- State machines for view and scene orchestration.
- Typed storage backed by memory, SharedPreferences, or encrypted SharedPreferences.
- Property delegates for persisted values, extras, views, and ViewModels.
- RecyclerView adapters, binders, and sticky headers.
- Foldable layout helpers.
- Application context provider.
Installation
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>")
}
Usage
Initialize storage and the context provider 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()
Platform Support
| Target | Support |
|---|
| Android | Supported from minSdk 20 |
Toolchain
| Tool | Version |
|---|
| Kotlin | 2.4.0 |
| Gradle | |
Documentation
Project guides and API documentation are published through GitHub Pages.
See CONTRIBUTING for the local workflow.
License
Licensed under the Apache License 2.0. See LICENSE.