From fdf235a1f6d59b3cbc9c7952c15dbffb8df43ece Mon Sep 17 00:00:00 2001 From: Gibran Chevalley Date: Mon, 19 Aug 2024 16:04:36 +0200 Subject: [PATCH] Extract dimensions to their own val --- .../infomaniak/swisstransfer/ui/components/BottomSheetItem.kt | 4 +++- .../com/infomaniak/swisstransfer/ui/components/LargeButton.kt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomSheetItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomSheetItem.kt index 34006ed9c..6dd39f4fd 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomSheetItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BottomSheetItem.kt @@ -36,12 +36,14 @@ import com.infomaniak.swisstransfer.ui.theme.CustomShapes import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme +private val BOTTOM_SHEET_ITEM_HEIGHT = 56.dp + @Composable fun BottomSheetItem(imageVector: ImageVector, @StringRes titleRes: Int, onClick: () -> Unit) { Button( colors = ButtonDefaults.textButtonColors(contentColor = SwissTransferTheme.colors.primaryTextColor), modifier = Modifier - .height(56.dp) + .height(BOTTOM_SHEET_ITEM_HEIGHT) .fillMaxWidth(), shape = CustomShapes.None, onClick = onClick, diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/LargeButton.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/LargeButton.kt index 962c61a59..1dc0c555b 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/LargeButton.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/LargeButton.kt @@ -37,6 +37,8 @@ import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.Shapes import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme +private val LARGE_BUTTON_HEIGHT = 56.dp + @Composable fun LargeButton( modifier: Modifier = Modifier, @@ -47,7 +49,7 @@ fun LargeButton( imageVector: ImageVector? = null, ) { Button( - modifier = modifier.height(56.dp), + modifier = modifier.height(LARGE_BUTTON_HEIGHT), colors = style.buttonColors(), shape = Shapes.medium, enabled = enabled,