feat(app): Koin bootstrap + AppTheme + Material3 XML theme (REDI-84)

- ArchitectureApp.Application: startKoin { androidLogger; androidContext; modules(coreDataModule) }.
  Modules are assembled only here; feature modules will append to the list.
- MainActivity hosts a themed empty screen via AppTheme + AppScaffold (design-system).
- Activity XML theme upgraded to Theme.Material3.DayNight.NoActionBar (Compose themes via AppTheme;
  the Material3 XML theme lets the later Views renderer inherit Material3 styling).
- :app depends on :core:data + :core:design-system; applies the koin convention.
This commit is contained in:
2026-06-10 11:48:19 +02:00
parent 5f3cc51195
commit 070ffde49c
5 changed files with 43 additions and 11 deletions

View File

@@ -1,13 +1,20 @@
plugins {
alias(libs.plugins.architecture.android.application)
alias(libs.plugins.architecture.compose)
alias(libs.plugins.architecture.koin)
}
dependencies {
// :app is the only place modules are assembled and the dependency graph is wired.
implementation(project(":core:data"))
implementation(project(":core:design-system"))
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.bundles.lifecycle.compose)
// Material Components — required for the Material3 XML Activity theme.
implementation(libs.material)
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.test.manifest)

View File

@@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:name=".ArchitectureApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"

View File

@@ -0,0 +1,24 @@
package com.example.architecture
import android.app.Application
import com.example.architecture.core.data.di.coreDataModule
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin
/**
* Single Koin entry point. Feature modules append their own `*DataModule` / `*PresentationModule`
* to the [modules] list — assembly happens only here, never inside feature modules.
*/
class ArchitectureApp : Application() {
override fun onCreate() {
super.onCreate()
startKoin {
androidLogger()
androidContext(this@ArchitectureApp)
modules(
coreDataModule,
)
}
}
}

View File

@@ -3,24 +3,24 @@ package com.example.architecture
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import com.example.architecture.core.design.system.component.AppScaffold
import com.example.architecture.core.design.system.theme.AppTheme
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
// Placeholder content. The real navigation host + AppTheme are wired in later
// milestones (design-system, characters graph, Koin bootstrap).
MaterialTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
// Compose themes via AppTheme; the navigation host lands in a later milestone.
AppTheme {
AppScaffold { innerPadding ->
Box(
modifier = Modifier
.fillMaxSize()

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Compose drives the in-app theming via AppTheme (core:design-system). This XML theme only
styles the Activity window. It is upgraded to a Material3 (Theme.Material3.*) parent in the
Koin-bootstrap milestone so the later hosted Views renderer inherits Material3 styling.
Compose drives the in-app theming via AppTheme (core:design-system); this XML theme styles
the Activity window. It uses a Material3 parent so the Views renderer hosted later (via
Compose<->View interop) inherits Material3 styling.
-->
<style name="Theme.AndroidArchitectureShowcase" parent="android:Theme.Material.Light.NoActionBar" />
<style name="Theme.AndroidArchitectureShowcase" parent="Theme.Material3.DayNight.NoActionBar" />
</resources>