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 { plugins {
alias(libs.plugins.architecture.android.application) alias(libs.plugins.architecture.android.application)
alias(libs.plugins.architecture.compose) alias(libs.plugins.architecture.compose)
alias(libs.plugins.architecture.koin)
} }
dependencies { 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.core.ktx)
implementation(libs.androidx.activity.compose) implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.runtime.ktx) implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.bundles.lifecycle.compose) implementation(libs.bundles.lifecycle.compose)
// Material Components — required for the Material3 XML Activity theme.
implementation(libs.material)
androidTestImplementation(libs.androidx.compose.ui.test.junit4) androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.test.manifest) debugImplementation(libs.androidx.compose.ui.test.manifest)

View File

@@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application <application
android:name=".ArchitectureApp"
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" 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 android.os.Bundle
import androidx.activity.ComponentActivity import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier 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() { class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent { setContent {
// Placeholder content. The real navigation host + AppTheme are wired in later // Compose themes via AppTheme; the navigation host lands in a later milestone.
// milestones (design-system, characters graph, Koin bootstrap). AppTheme {
MaterialTheme { AppScaffold { innerPadding ->
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()

View File

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