Skip to content

Conversation

@PureWeen
Copy link
Member

@PureWeen PureWeen commented Apr 17, 2025

Description of Change

This is an alternate fix to #28971

The first commit is just reverrting the above PR
e9a1bb2

The second commit is the actual fix
e9a1bb2

I realize the screenshots for the centering of the header/footer are different here on android vs iOS
But we already have an issue for that
#27738

Issues Fixed

Fixes #29051

Copilot AI review requested due to automatic review settings April 17, 2025 16:22
@PureWeen PureWeen requested a review from a team as a code owner April 17, 2025 16:22
@PureWeen PureWeen requested review from jsuarezruiz and mattleibow and removed request for a team April 17, 2025 16:22
@PureWeen PureWeen changed the title Fix footer resizing issue [SR5] Fix footer resizing issue Apr 17, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (4)

src/Controls/src/Core/Handlers/Items/iOS/StructuredItemsViewController.cs:241

  • The commented-out condition for the header view frame update may cause unnecessary updates or performance issues. Consider restoring the condition or refactoring it to only update when the frame values have actually changed.
if (_headerUIView != null/* && (_headerUIView.Frame.Y != -headerHeight || _headerUIView.Frame.Width != CollectionView.Frame.Width)*/)

src/Controls/src/Core/Handlers/Items/iOS/StructuredItemsViewController.cs:253

  • The commented condition for the footer view frame update removes a check that might prevent invalid layout recalculations. Ensure that the new logic still correctly handles footer positioning without causing layout glitches.
if (_footerUIView != null/* && (_footerUIView.Frame.Y != height || emptyHeight > 0 || _footerUIView.Frame.Height != footerHeight || _footerUIView.Frame.Width != CollectionView.Frame.Width)*/)

src/Controls/src/Core/Handlers/Items/iOS/MauiCollectionView.cs:30

  • Reversing the condition from 'if (isPropagating)' to 'if (!isPropagating)' changes the invalidation behavior, which could lead to missed or extra layout updates. Verify that this change is intentional and that it does not negatively impact cell layout updates.
if (!isPropagating)

src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs:199

  • Removing the block that resets the 'NeedsCellLayout' flag in ViewWillLayoutSubviews may alter the timing of layout updates. Confirm that this removal is valid and that no side effects occur in the layout behavior on iOS.
if (CollectionView is Items.MauiCollectionView { NeedsCellLayout: true } collectionView)

@PureWeen PureWeen force-pushed the fix_footer_resizing_issue branch from dc2e979 to 3b7f63c Compare April 17, 2025 16:29
Copy link
Member

@tj-devel709 tj-devel709 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Also passes the original issue. After the CreateDefaultMainPage is changed back, it looks good to me

@PureWeen PureWeen force-pushed the fix_footer_resizing_issue branch from 7941fe5 to f398a13 Compare April 17, 2025 21:06
{
var hasHeaderOrFooter = _footerViewFormsElement is not null || _headerViewFormsElement is not null;
if (hasHeaderOrFooter && CollectionView is MauiCollectionView { NeedsCellLayout: true } collectionView)
if (_headerFooterPositionNeedLayoutUpdate)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path here is the only interesting part of this PR

The rest of this PR is just reverting a PR that didn't fix the intended issue correctly

@PureWeen PureWeen merged commit dd13512 into release/9.0.1xx-sr5 Apr 18, 2025
77 of 79 checks passed
@PureWeen PureWeen deleted the fix_footer_resizing_issue branch April 18, 2025 14:23
@github-actions github-actions bot locked and limited conversation to collaborators May 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants