From 85f1917a8edaaf25e6ba530e453efd7467a4fc94 Mon Sep 17 00:00:00 2001 From: Fabian Devel Date: Thu, 5 Dec 2024 08:20:32 +0100 Subject: [PATCH] refactor: Add a dimen for DoubleButtonCombo --- .../ui/components/BottomStickyButtonScaffold.kt | 12 ++++-------- .../ui/components/SwissTransferBottomSheet.kt | 7 ++++++- .../com/infomaniak/swisstransfer/ui/theme/Dimens.kt | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomStickyButtonScaffold.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomStickyButtonScaffold.kt index 5f1e1ce07..7237ac290 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomStickyButtonScaffold.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomStickyButtonScaffold.kt @@ -29,7 +29,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextAlign import com.infomaniak.swisstransfer.R -import com.infomaniak.swisstransfer.ui.theme.Margin +import com.infomaniak.swisstransfer.ui.theme.Dimens import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @@ -53,15 +53,11 @@ fun BottomStickyButtonScaffold( .padding(contentPaddings), horizontalAlignment = Alignment.CenterHorizontally, ) { - Box( - modifier = Modifier - .weight(1.0f), - content = content, - ) + Box(modifier = Modifier.weight(1.0f), content = content) DoubleButtonCombo( - modifier = Modifier.padding(vertical = Margin.Small), + modifier = Modifier.padding(vertical = Dimens.ButtonComboVerticalPadding), topButton = topButton, - bottomButton = bottomButton + bottomButton = bottomButton, ) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt index 6c1e6caf3..1fbc249a5 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt @@ -40,6 +40,7 @@ import androidx.compose.ui.unit.dp import com.infomaniak.swisstransfer.R import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus import com.infomaniak.swisstransfer.ui.images.illus.ArrowDownRightCurved +import com.infomaniak.swisstransfer.ui.theme.Dimens import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme @@ -133,7 +134,11 @@ private fun BottomSheetContent( Spacer(Modifier.height(Margin.Large)) } - DoubleButtonCombo(topButton = topButton, bottomButton = bottomButton) + DoubleButtonCombo( + modifier = Modifier.padding(bottom = Dimens.ButtonComboVerticalPadding), + topButton = topButton, + bottomButton = bottomButton, + ) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/Dimens.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/Dimens.kt index b9529d038..547485b19 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/Dimens.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/Dimens.kt @@ -30,4 +30,5 @@ object Dimens { val SmallIconSize = 16.dp val IconSize = 24.dp val BorderWidth = 1.dp + val ButtonComboVerticalPadding = Margin.Small }