paparazzi
paparazzi copied to clipboard
NIGHT mode renders Compose as NOT_NIGHT
Setting up a DeviceConfig with NightMode.NIGHT, renders identical to NightMode.NOT_NIGHT. ie it does not make a difference and my Composable cannot be rendered in nightmode.
@get:Rule
val paparazzi = Paparazzi(
deviceConfig = DeviceConfig.NEXUS_5.copy(softButtons = false, screenHeight = 1, nightMode = NightMode.NIGHT),
renderingMode = SessionParams.RenderingMode.V_SCROLL,
)
@Test
fun largeLozengeButton() {
paparazzi.snapshot {
LargeLozengeButton(text = "New Project", {})
}
}
I am using this implements:
app.cash.paparazzi:paparazzi-gradle-plugin:1.0.0-SNAPSHOT
It looks like the frame of the system bars is affected by this setting, but Configuration.uiMode
flags don't have Configuration.UI_MODE_NIGHT_YES
in Configuration.UI_MODE_NIGHT_MASK
. I will take a look into it to find a way to contribute a fix for this.
Just created a workaround in #473. This theoretically should add support for night theming. This is what I got locally after applying the fix.
NightMode.NOTNIGHT |
NightMode.NIGHT |
---|---|
![]() |
![]() |
But I also want to test how it affects views: DayNight
themes and night
resource qualifier before making it ready for review.