diff --git a/androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml b/androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml index 2b068d1..69e62a6 100644 --- a/androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ b/androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -1,30 +1,23 @@ - - - - - - - - - + android:width="50dp" + android:height="50dp" + android:viewportWidth="960" + android:viewportHeight="960"> + + + + + + + \ No newline at end of file diff --git a/androidApp/src/main/res/drawable/ic_launcher_background.xml b/androidApp/src/main/res/drawable/ic_launcher_background.xml index e93e11a..b41fae4 100644 --- a/androidApp/src/main/res/drawable/ic_launcher_background.xml +++ b/androidApp/src/main/res/drawable/ic_launcher_background.xml @@ -5,166 +5,6 @@ android:viewportWidth="108" android:viewportHeight="108"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/data/resources/build.gradle.kts b/data/resources/build.gradle.kts index d5d9487..b226bba 100644 --- a/data/resources/build.gradle.kts +++ b/data/resources/build.gradle.kts @@ -24,5 +24,7 @@ kotlin { } compose.resources { + // Public so that other modules (e.g. shared UI) can reference drawables such as the app icon. + publicResClass = true packageOfResClass = "fr.ajaury.gwenedeg.resources.generated.resources" } diff --git a/data/resources/src/commonMain/composeResources/drawable/app_icon.xml b/data/resources/src/commonMain/composeResources/drawable/app_icon.xml new file mode 100644 index 0000000..61a50ca --- /dev/null +++ b/data/resources/src/commonMain/composeResources/drawable/app_icon.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index c153a7e..3fb3786 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -51,6 +51,7 @@ kotlin { implementation(libs.compose.material.icons.extended) implementation(libs.compose.ui) implementation(libs.compose.uiToolingPreview) + implementation(libs.compose.components.resources) // Lifecycle implementation(libs.lifecycle.viewmodelCompose) diff --git a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/records/ui/RecordsScreen.kt b/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/records/ui/RecordsScreen.kt index 53fcff4..061c96a 100644 --- a/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/records/ui/RecordsScreen.kt +++ b/shared/src/commonMain/kotlin/fr/ajaury/gwenedeg/records/ui/RecordsScreen.kt @@ -1,7 +1,11 @@ package fr.ajaury.gwenedeg.records.ui +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.itemsIndexed import androidx.compose.material3.ExperimentalMaterial3Api @@ -12,6 +16,7 @@ import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -19,7 +24,10 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import fr.ajaury.gwenedeg.core.model.Phrase import fr.ajaury.gwenedeg.records.model.Record import fr.ajaury.gwenedeg.records.ui.viewmodel.RecordsViewModel +import fr.ajaury.gwenedeg.resources.generated.resources.Res +import fr.ajaury.gwenedeg.resources.generated.resources.app_icon import fr.ajaury.gwenedeg.theme.ChomBevTheme +import org.jetbrains.compose.resources.painterResource import org.koin.compose.viewmodel.koinViewModel /** Display name of the application, shown as the title of the records screen. */ @@ -47,7 +55,19 @@ fun RecordsScreen( Scaffold( topBar = { TopAppBar( - title = { Text(text = APP_NAME) }, + title = { + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(8.dp), + ) { + Image( + painter = painterResource(Res.drawable.app_icon), + contentDescription = null, + modifier = Modifier.size(32.dp), + ) + Text(text = APP_NAME) + } + }, ) }, ) { innerPadding ->