1.47.0
Compose Preview Tester Customization
Added Capturer interface to AndroidComposePreviewTester for customizing capture behavior (#716). This allows setting custom
comparison thresholds and other RoborazziOptions for generated Compose preview tests.
import com.dropbox.differ.SimpleImageComparator
import com.github.takahirom.roborazzi.*
@ExperimentalRoborazziApi
class MyCustomComposePreviewTester(
private val defaultCapturer: AndroidComposePreviewTester.Capturer = AndroidComposePreviewTester.DefaultCapturer()
) : AndroidComposePreviewTester(
capturer = { parameter ->
val customOptions = parameter.roborazziOptions.copy(
compareOptions = parameter.roborazziOptions.compareOptions.copy(
// Set custom comparison threshold (0.0 = exact match, 1.0 = ignore differences)
imageComparator = SimpleImageComparator(maxDistance = 0.01f)
)
)
defaultCapturer.capture(
parameter.copy(roborazziOptions = customOptions)
)
}
)Fixes #703. Thanks @pavel163 for the issue report and @sergio-sastre for the review!
What's Changed
- Minor tweak to documentation for Groovy DSL by @smugleafdev in #715
- Add Capturer interface for customizing AndroidComposePreviewTester by @takahirom in #716
New Contributors
- @smugleafdev made their first contribution in #715
Full Changelog: 1.46.1...1.47.0