Skip to content

Fix isDisplayingAtLeast() matcher to factor in the scale of ancestor views. - #2503

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
piper_979797311
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
piper_979797311

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Sep 11, 2026

Copy link
Copy Markdown

Fix isDisplayingAtLeast() matcher to factor in the scale of ancestor views.

isDisplayingAtLeast(N) determines whether at least N% of a view is visible on the screen by comparing its visible area size against its total view size.

Prior to this change, the total view size calculation did not account for ancestor view scales, whereas the visible area size did. Because of this mismatch, isDisplayingAtLeast(90) would incorrectly return false even when the view was fully visible, specifically when one or more ancestor views were scaled down (shrunk).

This change resolves the issue by incorporating ancestor view scaling into the total view size calculation.

@copybara-service
copybara-service Bot force-pushed the piper_979797311 branch 2 times, most recently from cbcdbe2 to 2307673 Compare September 14, 2026 02:30
…r views.

`isDisplayingAtLeast(N)` determines whether at least N% of a view is visible on the screen by comparing its visible area size against its total view size.

Prior to this change, the total view size calculation did not account for ancestor view scales, whereas the visible area size did. Because of this mismatch, `isDisplayingAtLeast(90)` would incorrectly return `false` even when the view was fully visible, specifically when one or more ancestor views were scaled down (shrunk).

This change resolves the issue by incorporating ancestor view scaling into the total view size calculation.

PiperOrigin-RevId: 979797311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant