Skip to content
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

CollectionView causes invalid measurements on Android rotation #21967

Closed
jump32 opened this issue Apr 21, 2024 · 2 comments · Fixed by #22270
Closed

CollectionView causes invalid measurements on Android rotation #21967

jump32 opened this issue Apr 21, 2024 · 2 comments · Fixed by #22270
Assignees
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView partner/cat 😻 Client CAT Team platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@jump32
Copy link

jump32 commented Apr 21, 2024

Description

See attached githib for repo project.

When running the attached Android app on a simulator. The page initially looks correct. (Click Load)

image

After rotation however, the second row is displayed incorrectly.

image

In addition, in the debug output you can see some incorrect measure values of 390451572 x 390451572

image

And sometimes, after rotation, the app gets caught in a continuous Measure / Layout sequence that only stops when you rotate back to the original orientation.

Using Nightly - 8.0.40-nightly.10515

Steps to Reproduce

  • Run repo project on Android.
  • Click Load button.
  • Rotate device.
  • Scroll tiles up slightly to see second row.
  • Observe broken layout.
  • (In debugger) Observe random measure calls of 390451572 x 390451572

Link to public reproduction project repository

https://github.com/jump32/maui-app-collection-view-issue

Version with bug

Nightly / CI build (Please specify exact version)

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

It is possible that switching the Collection View to ItemSizingStrategy="MeasureAllItems".

Possible. But highly undesirable.

Relevant log output

Measure 184.36363636363637 x ∞
Measure 184.36363636363637 x ∞
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 390451572 x 390451572
Measure 390451572 x 390451572
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 390451572 x 390451572
Measure 390451572 x 390451572
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 184.36363636363637 x ∞
Measure 184.36363636363637 x ∞
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 390451572 x 390451572
Measure 390451572 x 390451572
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 390451572 x 390451572
Measure 390451572 x 390451572
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 184.36363636363637 x ∞
Measure 184.36363636363637 x ∞
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 390451572 x 390451572
Measure 390451572 x 390451572
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 390451572 x 390451572
Measure 390451572 x 390451572
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 184.36363636363637 x ∞
Measure 184.36363636363637 x ∞
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 390451572 x 390451572
Measure 390451572 x 390451572
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 390451572 x 390451572
Measure 390451572 x 390451572
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
Measure 389.45454545454544 x ∞
Measure 389.45454545454544 x ∞
ArrangeChildren {X=0 Y=0 Width=389.45454545454544 Height=584.3636363636364}
ArrangeChildren {X=0 Y=0 Width=389.45454545454544 Height=584.3636363636364}
Measure 389.45454545454544 x ∞
Measure 389.45454545454544 x ∞
ArrangeChildren {X=0 Y=0 Width=389.45454545454544 Height=584.3636363636364}
ArrangeChildren {X=0 Y=0 Width=389.45454545454544 Height=584.3636363636364}
Measure 390451572 x 390451572
Measure 390451572 x 390451572
ArrangeChildren {X=0 Y=0 Width=184.36363636363637 Height=276.72727272727275}
ArrangeChildren {X=0 Y=0 Width=184.72727272727272 Height=276.72727272727275}
@jump32 jump32 added the t/bug Something isn't working label Apr 21, 2024
@Zhanglirong-Winnie Zhanglirong-Winnie added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 22, 2024
@Zhanglirong-Winnie
Copy link
Collaborator

Verified this issue with Visual Studio 17.10.0 Preview 4(8.0.20&8.0.40-nightly.10515). Can repro on Android platform with sample project.
https://github.com/jump32/maui-app-collection-view-issue

@davidortinau
Copy link
Contributor

Verified fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView partner/cat 😻 Client CAT Team platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants