-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Android] CarouselView: Remove rounding from SizedItemContentView that results in off-by-one pixel error #25411
base: main
Are you sure you want to change the base?
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 wonder if this is still an issue after |
The two PRs fixed unrelated issues even if they touched on the same topic. |
36b1d84
to
69a227b
Compare
/rebase |
dded29b
to
28b45c6
Compare
src/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cs
Show resolved
Hide resolved
/rebase |
28b45c6
to
bdaae65
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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.Before:

After:

Issues Fixed