paparazzi icon indicating copy to clipboard operation
paparazzi copied to clipboard

Cannot take screenshot of ModalBottomSheetLayout

Open charbgr opened this issue 2 years ago • 1 comments

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

com theblueground snapshot_BottomSheetTest_BottomSheet screenshot test LIGHT

(that gray is the scrim color!)

charbgr avatar Jun 17 '22 09:06 charbgr

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 😅 )

Munzey avatar Aug 12 '22 15:08 Munzey

Appears to be fixed upstream: https://issuetracker.google.com/issues/241895902#comment5

Closing as this isn't a Paparazzi issue.

jrodbx avatar Dec 07 '22 05:12 jrodbx