
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.
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>")
}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()| Target | Support |
|---|---|
| Android | Supported from minSdk 20
|
| Tool | Version |
|---|---|
| Kotlin | 2.4.0 |
| Gradle | 9.5.1 |
| Java | 21 |
Project guides and API documentation are published through GitHub Pages. See CONTRIBUTING for the local workflow.
Licensed under the Apache License 2.0. See LICENSE.
A Kotlin-first Android toolkit with APIs designed for Android source sets in KMP projects.
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>")
}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()| Target | Support |
|---|---|
| Android | Supported from minSdk 20
|
| Tool | Version |
|---|---|
| Kotlin | 2.4.0 |
| Gradle | 9.5.1 |
| Java | 21 |
Project guides and API documentation are published through GitHub Pages. See CONTRIBUTING for the local workflow.
Licensed under the Apache License 2.0. See LICENSE.