mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-03 23:58:55 +01:00 
			
		
		
		
	Adjust stats overview icons
Closes #9865 Still sort of weird, but the icons are now always aligned.
This commit is contained in:
		@@ -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,
 | 
			
		||||
            )
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user