-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] CarouselView: Remove rounding from SizedItemContentView that results in off-by-one pixel error #25411
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
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not surprised it fails. I'm surprised it ever worked... The item is added, which triggers maui/src/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cs Lines 270 to 288 in c21b518
Next, Removing the delayed dispatch fixes this particular test.
|
I made a pragmatic change that should fix the test. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
8309fa1
to
738bc84
Compare
Was there a specific reason why this got closed? |
@filipnavara sorry it was my fault I screwed up the force push I think . Can you reopen with your local copy ? Thanks |
Gotcha. I'll reopen and force push a rebased version. |
738bc84
to
552cf31
Compare
We need to update images tests for CarouselView |
I can rebase it but it will likely fail the UI tests again because of the changed baseline and the images will need to be updated. Frankly, it's becoming quite cumbersome doing this for several months now. Replicating the issue with wrong scrolling may be a bit tricky. Replicating the wrong rounding resulting in wrongly sized items is already covered by existing tests. |
224f215
to
3879109
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run MAUI-DeviceTests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run MAUI-public |
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
Azure Pipelines successfully started running 1 pipeline(s). |
@rmarinho Thanks! |
Description of Change
CarouselViewHandler on Android has a measurement logic that converts back and forth between sizes in different units (
Context.FromPixels
/Context.ToPixels
). The logic inSizedItemContentView
was inadvertently rounding the values, resulting in some size measurement having an off-by-one width on certain devices and emulators (eg. 1079 instead of 1080). This in turn resulted in the carousel being scrolled to incorrect item on re-measurement triggered from closing a modal page.Issues Fixed