arch-android

Arch Android Toolkit

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.

Maven Central License Kotlin Lint Test Coverage


✨ Features

📦 Installation

// 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>")
}

🛠️ Usage

1) Configure storage at startup

class App : Application() {
    override fun onCreate() {
        super.onCreate()

        Storage.KeyValue.init(this)
        ContextProvider.init(this)
    }
}

2) Build a simple state machine

val machine = ViewStateMachine()
machine.setup {
    state(0) { visibles(viewA); gones(viewB) }
    state(1) { visibles(viewB); gones(viewA) }
}

machine.changeState(0)

3) Persist a typed config 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

This module is Android-focused, but the public API style favors KMP-friendly usage from androidMain and shared architecture layers.

🏗️ Built With

Tool Version
Kotlin 2.3.10
Gradle 9.3.1
Java 21

🔍 Quality Notes

🤝 Contributing

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.

📚 Documentation

For detailed API information, please refer to the KDocs.

📄 License

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.