
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 to fit well in KMP projects (Android source set) while keeping day-to-day Android development ergonomic.
StateMachine, ViewStateMachine, SceneStateMachine).ContextProvider.// build.gradle.kts
// If your project is KMP
kotlin {
sourceSets {
androidMain {
dependencies {
implementation("io.github.matheus-corregiari:arch-android:<latest-version>")
}
}
}
}
// If your project is only Android
dependencies {
implementation("io.github.matheus-corregiari:arch-android:<latest-version>")
}class App : Application() {
override fun onCreate() {
super.onCreate()
Storage.KeyValue.init(this)
ContextProvider.init(this)
}
}val machine = ViewStateMachine()
machine.setup {
state(0) { visibles(viewA); gones(viewB) }
state(1) { visibles(viewB); gones(viewA) }
}
machine.changeState(0)val darkMode = ConfigValue(
name = "dark_mode",
default = false,
storage = { Storage.KeyValue.regular }
)
darkMode.set(true)
val enabled = darkMode.get()| Target | Support |
|---|---|
| Android | ✅ |
This module is Android-focused, but the public API style favors KMP-friendly usage from
androidMainand shared architecture layers.
| Tool | Version |
|---|---|
| Kotlin | 2.3.10 |
| Gradle | 9.3.1 |
| Java | 21 |
ContextProvider uses WeakReference to reduce Activity leak risk.ObservableValue maintains an internal coroutine scope; prefer lifecycle-bounded instances.Contributions are welcome! If you find a bug or have a feature request, please open an issue. If you'd like to contribute code, please fork the repository and submit a pull request.
Please read CONTRIBUTING for a straightforward, KMP-focused workflow.
For detailed API information, please refer to the KDocs.
Copyright 2025 Matheus Corregiari
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
A Kotlin-first Android toolkit with APIs designed to fit well in KMP projects (Android source set) while keeping day-to-day Android development ergonomic.
StateMachine, ViewStateMachine, SceneStateMachine).ContextProvider.// build.gradle.kts
// If your project is KMP
kotlin {
sourceSets {
androidMain {
dependencies {
implementation("io.github.matheus-corregiari:arch-android:<latest-version>")
}
}
}
}
// If your project is only Android
dependencies {
implementation("io.github.matheus-corregiari:arch-android:<latest-version>")
}class App : Application() {
override fun onCreate() {
super.onCreate()
Storage.KeyValue.init(this)
ContextProvider.init(this)
}
}val machine = ViewStateMachine()
machine.setup {
state(0) { visibles(viewA); gones(viewB) }
state(1) { visibles(viewB); gones(viewA) }
}
machine.changeState(0)val darkMode = ConfigValue(
name = "dark_mode",
default = false,
storage = { Storage.KeyValue.regular }
)
darkMode.set(true)
val enabled = darkMode.get()| Target | Support |
|---|---|
| Android | ✅ |
This module is Android-focused, but the public API style favors KMP-friendly usage from
androidMainand shared architecture layers.
| Tool | Version |
|---|---|
| Kotlin | 2.3.10 |
| Gradle | 9.3.1 |
| Java | 21 |
ContextProvider uses WeakReference to reduce Activity leak risk.ObservableValue maintains an internal coroutine scope; prefer lifecycle-bounded instances.Contributions are welcome! If you find a bug or have a feature request, please open an issue. If you'd like to contribute code, please fork the repository and submit a pull request.
Please read CONTRIBUTING for a straightforward, KMP-focused workflow.
For detailed API information, please refer to the KDocs.
Copyright 2025 Matheus Corregiari
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.