Skip to content

Commit

Permalink
update Paparazzi to work on SDK 32
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Sep 29, 2022
1 parent 7513972 commit d72cca9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ui/src/test/kotlin/ScreenshotTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.unit.dp
import app.cash.paparazzi.DeviceConfig.Companion.PIXEL_5
import app.cash.paparazzi.Paparazzi
import app.cash.paparazzi.androidHome
import app.cash.paparazzi.detectEnvironment
import com.android.ide.common.rendering.api.SessionParams
import com.android.resources.NightMode
import kiwi.orbit.compose.ui.controls.AlertCriticalPreview
Expand Down Expand Up @@ -66,22 +68,24 @@ internal class ScreenshotTest {
@get:Rule
val paparazzi = Paparazzi(
theme = "android:Theme.Material.NoActionBar.Fullscreen",
renderingMode = SessionParams.RenderingMode.V_SCROLL,
environment = detectEnvironment().copy(
platformDir = "${androidHome()}/platforms/android-32",
compileSdkVersion = 32,
),
)

private fun snapshot(content: @Composable () -> Unit) {
paparazzi.unsafeUpdateConfig(
deviceConfig = PIXEL_5.copy(screenHeight = 1, softButtons = false),
renderingMode = SessionParams.RenderingMode.V_SCROLL,
)
paparazzi.snapshot { content() }
paparazzi.unsafeUpdateConfig(
deviceConfig = PIXEL_5.copy(screenHeight = 1, softButtons = false, fontScale = 1.6f),
renderingMode = SessionParams.RenderingMode.V_SCROLL,
)
paparazzi.snapshot(name = "big") { content() }
paparazzi.unsafeUpdateConfig(
deviceConfig = PIXEL_5.copy(screenHeight = 1, softButtons = false, nightMode = NightMode.NIGHT),
renderingMode = SessionParams.RenderingMode.V_SCROLL,
)
paparazzi.snapshot(name = "dark") {
// Workaround for https://github.com/cashapp/paparazzi/pull/473
Expand Down

0 comments on commit d72cca9

Please sign in to comment.