From 72f0127f742073253a8baa708ed7e9bffe8038ec Mon Sep 17 00:00:00 2001 From: machiav3lli Date: Mon, 10 Oct 2022 00:42:34 +0200 Subject: [PATCH] Update: Allow two-lines labels in ProductCard --- .../fdroid/ui/compose/components/ProductCard.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductCard.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductCard.kt index a06224bf..ff3719e1 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductCard.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductCard.kt @@ -1,6 +1,5 @@ package com.machiav3lli.fdroid.ui.compose.components -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.requiredSize @@ -13,7 +12,6 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp @@ -45,14 +43,13 @@ fun ProductCard( Surface( modifier = Modifier .padding(4.dp) - .requiredSize(80.dp, 116.dp), - tonalElevation = 8.dp, + .requiredSize(80.dp, 136.dp), + tonalElevation = 4.dp, shape = MaterialTheme.shapes.medium, onClick = { onUserClick(product) } ) { Column( - horizontalAlignment = Alignment.CenterHorizontally, - verticalArrangement = Arrangement.Center + modifier = Modifier.padding(8.dp), ) { NetworkImage( modifier = Modifier.size(64.dp), @@ -64,7 +61,7 @@ fun ProductCard( text = product.name, style = MaterialTheme.typography.bodySmall, overflow = TextOverflow.Ellipsis, - maxLines = 1, + maxLines = 2, color = MaterialTheme.colorScheme.onSurface ) Text(