diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/CrossCircleButton.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/CrossCircleButton.kt index 1f910edef..10a8c525a 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/CrossCircleButton.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/CrossCircleButton.kt @@ -17,6 +17,7 @@ */ package com.infomaniak.swisstransfer.ui.components +import android.content.res.Configuration import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.* @@ -26,6 +27,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.coerceAtLeast import androidx.compose.ui.unit.dp @@ -34,15 +36,13 @@ import com.infomaniak.swisstransfer.ui.images.AppImages import com.infomaniak.swisstransfer.ui.images.icons.CrossThick import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow -import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable @OptIn(ExperimentalMaterial3Api::class) fun BoxScope.CrossCircleButton(onClick: (() -> Unit)?, size: Dp = 48.dp) { - CompositionLocalProvider(LocalRippleConfiguration provides RippleConfiguration(color = Color.White)) { - val buttonPadding = ((size - 24.dp) / 2f).coerceAtLeast(0.dp) + val buttonPadding = ((size - 24.dp) / 2f).coerceAtLeast(0.dp) + CompositionLocalProvider(LocalRippleConfiguration provides RippleConfiguration(color = Color.White)) { Button( modifier = Modifier .size(size) @@ -64,8 +64,8 @@ fun BoxScope.CrossCircleButton(onClick: (() -> Unit)?, size: Dp = 48.dp) { } -@PreviewSmallWindow -@PreviewLargeWindow +@Preview(name = "Light") +@Preview(name = "Dark", uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL) @Composable private fun CrossCircleButtonPreview() { SwissTransferTheme {