Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AccessibilityRenderExtension with renderingMode = SHRINK error: IllegalArgumentException: Layout #1579

Closed
yogurtearl opened this issue Sep 11, 2024 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@yogurtearl
Copy link

This is a pure compose screenshot using Compose 1.7.1 and paparazzi 1.3.4

When using renderingMode = SHRINK and trying to add in AccessibilityRenderExtension() to an existing screen shot, we get this error.

It does adds the colored boxes, but doesn't added the side panel with all the accessibility labels.

Oddly, it also doubles the screenWidth that this set in a custom device config.

without renderingMode = SHRINK it works as expected.

    java.lang.IllegalArgumentException: Layout: -56 < 0
        at android.text.Layout.<init>(Layout.java:304)
        at android.text.StaticLayout.<init>(StaticLayout.java:634)
        at android.text.StaticLayout$Builder.build(StaticLayout.java:444)
        at app.cash.paparazzi.accessibility.AccessibilityOverlayDetailsView.draw(AccessibilityOverlayDetailsView.kt:79)
        at android.view.View.draw_Original(View.java:23762)
        at android.view.View_Delegate.draw(View_Delegate.java:68)
        at android.view.View.draw(View.java:23540)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4556)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317)
        at android.view.View.draw_Original(View.java:23760)
        at android.view.View_Delegate.draw(View_Delegate.java:68)
        at android.view.View.draw(View.java:23540)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4556)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317)
        at android.view.View.draw_Original(View.java:23760)
        at android.view.View_Delegate.draw(View_Delegate.java:68)
        at android.view.View.draw(View.java:23540)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4556)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317)
        at android.view.View.draw_Original(View.java:23760)
        at android.view.View_Delegate.draw(View_Delegate.java:68)
        at android.view.View.draw(View.java:23540)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4556)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317)
        at android.view.View.draw_Original(View.java:23760)
        at android.view.View_Delegate.draw(View_Delegate.java:68)
        at android.view.View.draw(View.java:23540)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4556)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317)
        at android.view.View.draw_Original(View.java:23892)
        at android.view.View_Delegate.draw(View_Delegate.java:56)
        at android.view.View.draw(View.java:23862)
        at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:558)
        at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:445)
        at app.cash.paparazzi.PaparazziSdk$takeSnapshots$3.invoke(PaparazziSdk.kt:289)
        at app.cash.paparazzi.PaparazziSdk$takeSnapshots$3.invoke(PaparazziSdk.kt:288)
        at app.cash.paparazzi.PaparazziSdk.withTime(PaparazziSdk.kt:340)
        at app.cash.paparazzi.PaparazziSdk.takeSnapshots(PaparazziSdk.kt:288)
        at app.cash.paparazzi.PaparazziSdk.snapshot(PaparazziSdk.kt:179)
        at app.cash.paparazzi.PaparazziSdk.snapshot$default(PaparazziSdk.kt:178)
        at app.cash.paparazzi.PaparazziSdk.snapshot(PaparazziSdk.kt:174)
        at app.cash.paparazzi.Paparazzi.snapshot(Paparazzi.kt:103)
        at app.cash.paparazzi.Paparazzi.snapshot$default(Paparazzi.kt:100)
@yogurtearl yogurtearl added the bug Something isn't working label Sep 11, 2024
@geoff-powell geoff-powell added the duplicate This issue or pull request already exists label Sep 12, 2024
@geoff-powell
Copy link
Collaborator

Closing as its a duplicate of #1350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants