-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fixed CollectionView MeasureFirstItem ItemSizingStrategy Not Applied in Horizontal Layouts #29474
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
base: main
Are you sure you want to change the base?
Conversation
|
Hey there @@NanthiniMahalingam! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
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.
Pull Request Overview
This pull request fixes an issue on Android where the CollectionView MeasureFirstItem sizing was not applied correctly in horizontal layouts. The changes ensure that the first item's size is preserved and correctly propagated, while also introducing an UpdateAdapter method to handle layout orientation changes.
- Removed an unnecessary assignment that reset the first item's pixel size.
- Updated the ItemsLayout mapping to call UpdateAdapter before updating the layout manager.
- Added test cases to validate the fix on multiple platforms (Android, Windows, iOS, macOS).
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29192.cs | Added test case for verifying MeasureFirstItem sizing in CollectionView. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue29192.cs | Introduced a sample ContentPage to test the horizontal layout behavior. |
| src/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.Android.cs | Updated MapItemsLayout to call UpdateAdapter, ensuring correct adapter updates. |
| src/Controls/src/Core/Handlers/Items/Android/ItemContentView.cs | Removed a duplicate assignment resetting _pixelSize to null. |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jsuarezruiz
left a comment
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.
Hi @jsuarezruiz , I've addressed the failing test case. Could you please verify it? |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/rebase |
e85f80e to
e4c4428
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |


Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Details
Root Cause
Description of Changes
Validated the behaviour in the following platforms
Issues Fixed
Fixes #29192
Output images
Android
Issue29192_Before.mov