From 361ef97ccff82daa408a975c63cd82dca6021c4a Mon Sep 17 00:00:00 2001 From: Florent Maitre Date: Wed, 20 Sep 2023 15:48:40 +0200 Subject: [PATCH] [#597] Review: Fix a padding bug in cards --- .../orange/ods/app/ui/components/cards/CardHorizontal.kt | 9 ++++----- .../com/orange/ods/app/ui/components/cards/CardSmall.kt | 9 ++++----- .../app/ui/components/cards/CardVerticalHeaderFirst.kt | 9 ++++----- .../app/ui/components/cards/CardVerticalImageFirst.kt | 9 ++++----- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardHorizontal.kt b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardHorizontal.kt index 1ab38d816..b6fae1d17 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardHorizontal.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardHorizontal.kt @@ -11,7 +11,6 @@ package com.orange.ods.app.ui.components.cards import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState @@ -45,8 +44,8 @@ fun CardHorizontal(customizationState: CardCustomizationState) { Column( modifier = Modifier .fillMaxSize() + .verticalScroll(state = rememberScrollState()) .padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) - .verticalScroll(state = rememberScrollState()), ) { val firstButtonText = stringResource(id = R.string.component_element_first_button) val secondButtonText = stringResource(id = R.string.component_element_second_button) @@ -73,9 +72,9 @@ fun CardHorizontal(customizationState: CardCustomizationState) { divider = hasDivider ) - Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) - - CodeImplementationColumn { + CodeImplementationColumn( + modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s)) + ) { FunctionCallCode( name = OdsComposable.OdsHorizontalCard.name, exhaustiveParameters = false, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardSmall.kt b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardSmall.kt index f525f3db5..43373222d 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardSmall.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardSmall.kt @@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState @@ -47,8 +46,8 @@ fun CardSmall(customizationState: CardCustomizationState) { Column( modifier = Modifier .fillMaxSize() + .verticalScroll(state = rememberScrollState()) .padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) - .verticalScroll(state = rememberScrollState()), ) { Row( modifier = Modifier @@ -76,9 +75,9 @@ fun CardSmall(customizationState: CardCustomizationState) { Box(modifier = Modifier.weight(0.5f)) } - Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) - - CodeImplementationColumn { + CodeImplementationColumn( + modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s)) + ) { FunctionCallCode( name = OdsComposable.OdsSmallCard.name, exhaustiveParameters = false, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalHeaderFirst.kt b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalHeaderFirst.kt index 56ece9cb3..df11b68d0 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalHeaderFirst.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalHeaderFirst.kt @@ -11,7 +11,6 @@ package com.orange.ods.app.ui.components.cards import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState @@ -48,8 +47,8 @@ fun CardVerticalHeaderFirst(customizationState: CardCustomizationState) { Column( modifier = Modifier .fillMaxSize() + .verticalScroll(state = rememberScrollState()) .padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) - .verticalScroll(state = rememberScrollState()), ) { val firstButtonText = stringResource(id = R.string.component_element_first_button) val secondButtonText = stringResource(id = R.string.component_element_second_button) @@ -76,9 +75,9 @@ fun CardVerticalHeaderFirst(customizationState: CardCustomizationState) { secondButton = if (hasSecondButton) OdsCardButton(secondButtonText) { clickOnElement(context, secondButtonText) } else null, ) - Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) - - CodeImplementationColumn { + CodeImplementationColumn( + modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s)) + ) { FunctionCallCode( name = OdsComposable.OdsVerticalHeaderFirstCard.name, exhaustiveParameters = false, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalImageFirst.kt b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalImageFirst.kt index c770806e4..b7f38c9f5 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalImageFirst.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalImageFirst.kt @@ -11,7 +11,6 @@ package com.orange.ods.app.ui.components.cards import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState @@ -45,8 +44,8 @@ fun CardVerticalImageFirst(customizationState: CardCustomizationState) { Column( modifier = Modifier .fillMaxSize() + .verticalScroll(state = rememberScrollState()) .padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) - .verticalScroll(state = rememberScrollState()), ) { val firstButtonText = stringResource(id = R.string.component_element_first_button) val secondButtonText = stringResource(id = R.string.component_element_second_button) @@ -71,9 +70,9 @@ fun CardVerticalImageFirst(customizationState: CardCustomizationState) { secondButton = if (hasSecondButton) OdsCardButton(secondButtonText) { clickOnElement(context, secondButtonText) } else null, ) - Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) - - CodeImplementationColumn { + CodeImplementationColumn( + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)) + ) { FunctionCallCode( name = OdsComposable.OdsVerticalImageFirstCard.name, exhaustiveParameters = false,