[Android] CarouselView: Remove rounding from SizedItemContentView that results in off-by-one pixel error#25411
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
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 inSizedItemContentViewwas 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