From d9acb479292aec78f21761165512a6b1264c6780 Mon Sep 17 00:00:00 2001 From: Till Hellmund Date: Fri, 11 Aug 2023 10:55:39 -0400 Subject: [PATCH] Add rounded corners to `BottomSheet` --- .../main/java/com/stripe/android/common/ui/BottomSheet.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/paymentsheet/src/main/java/com/stripe/android/common/ui/BottomSheet.kt b/paymentsheet/src/main/java/com/stripe/android/common/ui/BottomSheet.kt index 787966f94cb..3d8acb62309 100644 --- a/paymentsheet/src/main/java/com/stripe/android/common/ui/BottomSheet.kt +++ b/paymentsheet/src/main/java/com/stripe/android/common/ui/BottomSheet.kt @@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.layout.windowInsetsBottomHeight +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.ModalBottomSheetDefaults import androidx.compose.material.ModalBottomSheetLayout @@ -30,6 +31,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.testTag import androidx.compose.ui.unit.dp import com.google.accompanist.systemuicontroller.rememberSystemUiController +import com.stripe.android.uicore.StripeThemeDefaults import kotlinx.coroutines.CancellationException import kotlinx.coroutines.flow.first @@ -159,6 +161,10 @@ internal fun BottomSheet( .statusBarsPadding() .imePadding(), sheetState = state.modalBottomSheetState, + sheetShape = RoundedCornerShape( + topStart = StripeThemeDefaults.shapes.cornerRadius.dp, + topEnd = StripeThemeDefaults.shapes.cornerRadius.dp, + ), sheetContent = { Box(modifier = Modifier.testTag(BottomSheetContentTestTag)) { sheetContent()