From 9ce0bc6b5fbdf8b8008adb1feae21b8346223453 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 26 Nov 2023 18:45:16 -0500 Subject: [PATCH] Adjust stats overview icons Closes #9865 Still sort of weird, but the icons are now always aligned. --- .../more/stats/StatsScreenContent.kt | 17 +++++++++++------ .../more/stats/components/StatsItem.kt | 7 ++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/stats/StatsScreenContent.kt b/app/src/main/java/eu/kanade/presentation/more/stats/StatsScreenContent.kt index f35336d501..64f59280ca 100644 --- a/app/src/main/java/eu/kanade/presentation/more/stats/StatsScreenContent.kt +++ b/app/src/main/java/eu/kanade/presentation/more/stats/StatsScreenContent.kt @@ -1,8 +1,10 @@ package eu.kanade.presentation.more.stats import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.IntrinsicSize import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.height import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.material.icons.Icons @@ -12,6 +14,7 @@ import androidx.compose.material.icons.outlined.Schedule import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import eu.kanade.presentation.more.stats.components.StatsItem import eu.kanade.presentation.more.stats.components.StatsOverviewItem @@ -63,22 +66,24 @@ private fun OverviewSection( .toDurationString(context, fallback = none) } StatsSection(MR.strings.label_overview_section) { - Row { + Row( + modifier = Modifier.height(IntrinsicSize.Min), + ) { StatsOverviewItem( title = data.libraryMangaCount.toString(), subtitle = stringResource(MR.strings.in_library), icon = Icons.Outlined.CollectionsBookmark, ) - StatsOverviewItem( - title = data.completedMangaCount.toString(), - subtitle = stringResource(MR.strings.label_completed_titles), - icon = Icons.Outlined.LocalLibrary, - ) StatsOverviewItem( title = readDurationString, subtitle = stringResource(MR.strings.label_read_duration), icon = Icons.Outlined.Schedule, ) + StatsOverviewItem( + title = data.completedMangaCount.toString(), + subtitle = stringResource(MR.strings.label_completed_titles), + icon = Icons.Outlined.LocalLibrary, + ) } } } diff --git a/app/src/main/java/eu/kanade/presentation/more/stats/components/StatsItem.kt b/app/src/main/java/eu/kanade/presentation/more/stats/components/StatsItem.kt index 32f4fcd28b..8002b3d048 100644 --- a/app/src/main/java/eu/kanade/presentation/more/stats/components/StatsItem.kt +++ b/app/src/main/java/eu/kanade/presentation/more/stats/components/StatsItem.kt @@ -3,6 +3,8 @@ package eu.kanade.presentation.more.stats.components import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -53,7 +55,9 @@ private fun RowScope.BaseStatsItem( icon: ImageVector? = null, ) { Column( - modifier = Modifier.weight(1f), + modifier = Modifier + .weight(1f) + .fillMaxHeight(), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small), horizontalAlignment = Alignment.CenterHorizontally, ) { @@ -74,6 +78,7 @@ private fun RowScope.BaseStatsItem( textAlign = TextAlign.Center, ) if (icon != null) { + Spacer(modifier = Modifier.weight(1f)) Icon( imageVector = icon, contentDescription = null,