paparazzi
paparazzi copied to clipboard
Cannot take screenshot of ModalBottomSheetLayout
Description Am trying to take screenshot of ModalBottomSheetLayout but instead I get only the scrim!
I tried to change the animationspec of ModalBottomSheetLayout
to:
val keyframesSpecConfig = KeyframesSpec.KeyframesSpecConfig<Float>().apply {
durationMillis = 0
0f at 100
}
val modalBottomSheetState = rememberModalBottomSheetState(
initialValue = ModalBottomSheetValue.Expanded,
animationSpec = KeyframesSpec(keyframesSpecConfig)
)
but with no luck!
Steps to Reproduce
@Test
fun `BottomSheet screenshot test`(
@TestParameter theme: Theme
) = paparazzi.snapshot() {
val modalBottomSheetState = rememberModalBottomSheetState(
initialValue = ModalBottomSheetValue.Expanded
)
ModalBottomSheetLayout(
sheetContent = { OurSheetContent() },
sheetState = modalBottomSheetState,
) {
// ...
}
}
Expected behavior I would expect to have the bottomsheet fully expanded and take the screenshot!
Additional information:
- Paparazzi Version: 1.0.0
- OS: macOS
- Compile SDK: 31
- Gradle Version: 7.4.2
- Android Gradle Plugin Version: 7.2.0
Screenshots
(that gray is the scrim color!)
Was just pointed here because of a similar issue and thought I'd point to a bug I opened: https://issuetracker.google.com/issues/241895902 Its a compose issue, not paparazzi.
Right now in a local preview only way to see this is to click in interactive mode. I believe there are similar issues with BottomSheetScaffold
Spoke with Jossi Wolf and it will be fixed (I'm not sure if soon though 😅 )
Appears to be fixed upstream: https://issuetracker.google.com/issues/241895902#comment5
Closing as this isn't a Paparazzi issue.