new: add app icon and display it in the records screen

This commit is contained in:
2026-07-03 16:04:16 +02:00
parent 8d3da32454
commit bf059d5519
6 changed files with 64 additions and 190 deletions
@@ -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 ->