Skip to content

[iOS] CollectionView2 - empty view - improvements#28119

Closed
kubaflo wants to merge 2 commits intodotnet:mainfrom
kubaflo:iOS]-CollectionView2---empty-view
Closed

[iOS] CollectionView2 - empty view - improvements#28119
kubaflo wants to merge 2 commits intodotnet:mainfrom
kubaflo:iOS]-CollectionView2---empty-view

Conversation

@kubaflo
Copy link
Copy Markdown
Contributor

@kubaflo kubaflo commented Mar 1, 2025

Issues Fixed

Fixes #28118

Before After
Screen.Recording.2025-03-01.at.16.06.17.mov
Screen.Recording.2025-03-01.at.16.04.15.mov

@kubaflo kubaflo requested a review from a team as a code owner March 1, 2025 15:44
@kubaflo kubaflo requested review from PureWeen and tj-devel709 March 1, 2025 15:44
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Mar 1, 2025
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Copy Markdown
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Can include an UITest using the same from #28118? Can use methods to try to drag the EmptyView and verify the position for example with a reference snapshot.

@kubaflo
Copy link
Copy Markdown
Contributor Author

kubaflo commented Mar 3, 2025

Can include an UITest using the same from #28118? Can use methods to try to drag the EmptyView and verify the position for example with a reference snapshot.

Added

@jfversluis jfversluis added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Mar 25, 2025
@jsuarezruiz
Copy link
Copy Markdown
Contributor

/rebase

@github-actions github-actions bot force-pushed the iOS]-CollectionView2---empty-view branch from 74d5dac to 4be364b Compare March 28, 2025 09:44
@kubaflo kubaflo self-assigned this Mar 29, 2025
@kubaflo kubaflo force-pushed the iOS]-CollectionView2---empty-view branch from 4be364b to 8ea0e36 Compare March 29, 2025 00:15
@rmarinho rmarinho added this to the .NET 9 SR7 milestone Apr 11, 2025
@rmarinho rmarinho moved this from Todo to Ready To Review in MAUI SDK Ongoing Apr 11, 2025

if (isEmpty)
{
CollectionView.LayoutIfNeeded();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need to call this if we setting the ContentInset wouldn't t that call layout?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Turns out it doesn't. I tried without it on the latest main and it doesn't work

RemeasureLayout(_emptyViewFormsElement);
frame = new CGRect(frame.X, frame.Y, frame.Width, Math.Max(frame.Height, _emptyViewFormsElement.Height));
_emptyUIView.Frame = frame;
CollectionView.ContentInset = new UIEdgeInsets(0, 0, frame.Height, 0);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IS this the best way to do it ? Why do we need to inset?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Without it, a CollectionView with an empty view whose height exceeds the frame won't scroll.

@rmarinho
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Copy Markdown
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

Some questions, special related with inset, should we try add EmtptyView in other way so CollectionView knows how to handle properly without use of insets?

@github-project-automation github-project-automation bot moved this from Ready To Review to Changes Requested in MAUI SDK Ongoing Apr 21, 2025
@kubaflo
Copy link
Copy Markdown
Contributor Author

kubaflo commented Apr 22, 2025

Some questions, special related with inset, should we try add EmtptyView in other way so CollectionView knows how to handle properly without use of insets?

I can look into it further, unless you already have something specific in mind.

@kubaflo
Copy link
Copy Markdown
Contributor Author

kubaflo commented Apr 23, 2025

Some questions, special related with inset, should we try add EmtptyView in other way so CollectionView knows how to handle properly without use of insets?

@rmarinho what do you think about this: #29154

@PureWeen PureWeen modified the milestones: .NET 9 SR7, .NET 9 SR8 May 8, 2025
@PureWeen PureWeen removed this from the .NET 9 SR8 milestone May 8, 2025
@PureWeen
Copy link
Copy Markdown
Member

PureWeen commented May 8, 2025

closing in favor of #29154

@PureWeen PureWeen closed this May 8, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] CollectionView2 - empty view issues

5 participants