-
Notifications
You must be signed in to change notification settings - Fork 212
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
AccessibliityRenderExtension
causes layout bug when content uses animateContentSize
modifier
#1165
Comments
I'll be able to dig into this within the next week! |
Wanted to provide an update on what I've found so far. From my testing the issue only seems to happen when the contentView we want to take a snapshot of is added to a container where it is no longer the full size, which occurs with the AccessibilityRenderExtension. Here we're creating a new LinearLayout x2 the size of the original snapshot size with a weight of 2 and adding the contentView and the accessibility legend output. For some reason that I haven't yet discovered, this causes the contentView to get offset by exactly half the width. After messing with the |
Where are you changing these params? Is that something that is feasible to do by default inside |
I was setting these directly inside
|
After many, many different trial and error attempts, I do finally have a solution that doesn't involve changing the
@jrodbx what are your thoughts on this. I could have a PR with a change to add a MotionDurationScale that always uses a value of 0, but thinking out loud; this might not be the best way to do it since if you want to snapshot a gif of an animation, it would disable that. I don't think this can be done via a rule either since it needs to be supplied to the coroutine context inside Paparazzi.. |
For 1, maybe Paparazzi could read the |
Unfortunately I don't think there's a way for us to know within Paparazzi if |
I meant checking the effects of |
Oh gotcha, yeah that definitely seems like it would work! |
Description
When any part of Compose UI content uses the
animateContentSize
modifier, andAccessibilityRenderExtension
is used, the content is offset 50% to the left of where it should be, leaving a blank gap in the remaining 50% of space in between the shifted content and the rendered accessibility info. This occurs even ifInstantAnimationsRule
is used.It does not occur if
AccessibilityRenderExtension
is not used.Steps to Reproduce
./gradlew sample:recordPaparazziDebug --tests=ComposeA11yTest
app.cash.paparazzi.sample_ComposeA11yTest_animateContentSize[false].png
andapp.cash.paparazzi.sample_ComposeA11yTest_animateContentSize[true].png
Note that the image with
renderAccessibilityInfo
set to false renders correctly, while the one withrenderAccessibilityInfo
set to true incorrectly offsets the content.Expected behavior
The content should not be offset.
Additional information:
Screenshots
![app cash paparazzi sample_ComposeA11yTest_animateContentSize true](https://private-user-images.githubusercontent.com/2267660/287400770-6c4b761e-23ce-4264-93f3-4bea7be0e4da.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxMzExMjYsIm5iZiI6MTcyMjEzMDgyNiwicGF0aCI6Ii8yMjY3NjYwLzI4NzQwMDc3MC02YzRiNzYxZS0yM2NlLTQyNjQtOTNmMy00YmVhN2JlMGU0ZGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjhUMDE0MDI2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmIxZjA5NjdhN2VkZDk5ZmUwYzhjZmZlOTdmNTEyY2MyZmFmYWE5ZjA0ZTAyYWU5OTU3YzJjOTk5ZGZjZjZiNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.LESNiJd878Vi2ajGOGP2y1oBiNavrOMu_xAjVoZVSCg)
The text was updated successfully, but these errors were encountered: