Is it possible to let paparazzi only do a screensh...
# squarelibraries
p
Is it possible to let paparazzi only do a screenshot of the actual composable? For example here I’d like to have the composable without the statusbar and with the whole screen height.
c
I quickly tested the lib yesterday and I do not see the status bar. What „device“ config are you using?
p
@get:Rule val paparazzi = Paparazzi( theme = “android:Theme.Material.Light.NoActionBar”, deviceConfig = DeviceConfig.NEXUS_5.copy(softButtons = false), )
Uuh got it working
Copy code
@get:Rule
  val paparazzi = Paparazzi(
    deviceConfig = DeviceConfig.PIXEL_4.copy(softButtons = false, screenHeight = 1),
    renderingMode = SessionParams.RenderingMode.V_SCROLL
  )
👏 2
c
But that is still strange. I have
Copy code
class ProfileScreenShould {

    @get:Rule
    val paparazzi = Paparazzi(
        deviceConfig = DeviceConfig.PIXEL_5,
    )

    @Test
    fun renderOnPixel5() {
        paparazzi.snapshot {
            ProfileScreen()
        }
    }
}
with this Composabe
Copy code
@Composable
fun ProfileScreen() {
    MaterialTheme {
        Scaffold(
            topBar = {
                TopAppBar(
                    title = {
                        Text("Paparazzi")
                    }
                )
            }
        ) {
            Box(
                modifier = Modifier
                    .fillMaxSize()
                    .padding(it),
                contentAlignment = Alignment.Center
            ) {
                Text(
                    "Hello Paparazzi!",
                    style = MaterialTheme.typography.h3
                )
            }
        }
    }
}
and don’t see a status bar
p
Because you don't have a theme
c
Ah, didn’t see that in your first snippet. Good to know!
190 Views