Skip to content

Commit

Permalink
Use a static scrim color for the BottomSheet used in PaymentSheet (
Browse files Browse the repository at this point in the history
  • Loading branch information
samer-stripe authored Dec 9, 2024
1 parent 0eb1931 commit c13fae8
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ internal fun ElementsBottomSheetLayout(
) {
@Suppress("DEPRECATION")
val systemUiController = rememberSystemUiController()
val layoutInfo = rememberStripeBottomSheetLayoutInfo()
val layoutInfo = rememberStripeBottomSheetLayoutInfo(
scrimColor = Color.Black.copy(alpha = 0.32f),
)

LaunchedEffect(Unit) {
state.skipHideAnimation = skipHideAnimation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.stripe.android.common.ui

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetValue
import androidx.compose.material.Text
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.stripe.android.screenshottesting.PaparazziRule
import com.stripe.android.screenshottesting.SystemAppearance
import com.stripe.android.uicore.elements.bottomsheet.rememberStripeBottomSheetState
import org.junit.Rule
import org.junit.Test

@OptIn(ExperimentalMaterialApi::class)
class ElementsBottomSheetLayoutScreenshotTest {
@get:Rule
val paparazzi = PaparazziRule(
SystemAppearance.entries,
boxModifier = Modifier
.padding(0.dp)
.fillMaxSize(),
)

@Test
fun testExpanded() {
paparazzi.snapshot {
Text(
text = "My screen",
modifier = Modifier.padding(20.dp)
)

ElementsBottomSheetLayout(
state = rememberStripeBottomSheetState(
initialValue = ModalBottomSheetValue.Expanded,
),
onDismissed = {},
) {
Text(
text = "My bottom sheet",
modifier = Modifier.padding(20.dp)
)
}
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c13fae8

Please sign in to comment.