From 2e2d4ed8e8ea34190ce9cf1580f98bd225833da1 Mon Sep 17 00:00:00 2001 From: Xavier Molloy <44061143+xavimolloy@users.noreply.github.com> Date: Wed, 15 Nov 2023 09:07:12 +0100 Subject: [PATCH] feat: [ANDROAPP-5728] mobile-ui-Change-show-more-color-and-correct-alignment-in-ListCard-component (#143) * [ANDROAPP-5728] change show more/less item colour and fix alignment * [ANDROAPP-5728] Correct vertical alignment for show more component --- .../dhis/mobile/ui/designsystem/component/ListCard.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCard.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCard.kt index 8cdb5da83..32dedb118 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCard.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCard.kt @@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.widthIn @@ -40,6 +41,7 @@ import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.testTag import androidx.compose.ui.semantics.Role import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp import org.hisp.dhis.mobile.ui.designsystem.component.internal.conditional import org.hisp.dhis.mobile.ui.designsystem.resource.provideDHIS2Icon import org.hisp.dhis.mobile.ui.designsystem.resource.provideStringResource @@ -335,8 +337,7 @@ private fun AdditionalInfoColumn( } else { Icons.Filled.KeyboardArrowUp } - val verticalPadding = if (isDetailCard) Spacing.Spacing10 else Spacing.Spacing0 - val expandTextColor = if (isDetailCard) TextColor.OnSurfaceLight else SurfaceColor.Primary + val expandTextColor = TextColor.OnSurfaceLight Row( Modifier .clip(RoundedCornerShape(Radius.M)) @@ -351,7 +352,9 @@ private fun AdditionalInfoColumn( color = SurfaceColor.Primary, ), ) - .padding(top = verticalPadding, end = Spacing.Spacing2, bottom = verticalPadding), + .padding(end = Spacing.Spacing2) + .offset(x = (-3).dp), + verticalAlignment = Alignment.CenterVertically, ) { Icon( imageVector = iconVector, @@ -363,6 +366,7 @@ private fun AdditionalInfoColumn( color = expandTextColor, style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(horizontal = Spacing4), + ) } }