diff --git a/paparazzi/paparazzi/src/main/java/app/cash/paparazzi/Paparazzi.kt b/paparazzi/paparazzi/src/main/java/app/cash/paparazzi/Paparazzi.kt index a4bf8ba1ac..1af6e87ed4 100644 --- a/paparazzi/paparazzi/src/main/java/app/cash/paparazzi/Paparazzi.kt +++ b/paparazzi/paparazzi/src/main/java/app/cash/paparazzi/Paparazzi.kt @@ -86,7 +86,8 @@ class Paparazzi @JvmOverloads constructor( private val appCompatEnabled: Boolean = true, private val maxPercentDifference: Double = 0.1, private val snapshotHandler: SnapshotHandler = determineHandler(maxPercentDifference), - private val renderExtensions: Set = setOf() + private val renderExtensions: Set = setOf(), + private val supportsRtl: Boolean = false ) : TestRule { private val logger = PaparazziLogger() private lateinit var renderSession: RenderSessionImpl @@ -158,7 +159,8 @@ class Paparazzi @JvmOverloads constructor( .copy( layoutPullParser = LayoutPullParser.createFromString(contentRoot), deviceConfig = deviceConfig, - renderingMode = renderingMode + renderingMode = renderingMode, + supportsRtl = supportsRtl ) .withTheme(theme) diff --git a/paparazzi/paparazzi/src/main/java/app/cash/paparazzi/internal/SessionParamsBuilder.kt b/paparazzi/paparazzi/src/main/java/app/cash/paparazzi/internal/SessionParamsBuilder.kt index 0ba4712e03..9c943d983a 100644 --- a/paparazzi/paparazzi/src/main/java/app/cash/paparazzi/internal/SessionParamsBuilder.kt +++ b/paparazzi/paparazzi/src/main/java/app/cash/paparazzi/internal/SessionParamsBuilder.kt @@ -48,7 +48,8 @@ internal data class SessionParamsBuilder( private val layoutPullParser: LayoutPullParser? = null, private val projectKey: Any? = null, private val minSdk: Int = 0, - private val decor: Boolean = true + private val decor: Boolean = true, + private val supportsRtl: Boolean = false ) { fun withTheme( themeName: String, @@ -105,7 +106,7 @@ internal data class SessionParamsBuilder( } else { result.locale = localeQualifier.tag } - result.setRtlSupport(true) + result.setRtlSupport(supportsRtl) for ((key, value) in flags) { result.setFlag(key as Key, value)