Conversation
Co-authored-by: E.Z. Hart <hartez@users.noreply.github.com>
hartez
left a comment
There was a problem hiding this comment.
Questions about the empty view size changes.
| if (!double.IsInfinity(height)) | ||
| height = Context.ToPixels(height); | ||
|
|
||
| UpdateEmptyViewSize(width, height); |
There was a problem hiding this comment.
This will set the empty view size to (widthConstraint, heightConstraint) - that's exactly what Jon's comment was worried about. Shouldn't it use the result of the measurement?
Also, is it even necessary to update the empty view size during measure? It's already being updated during Arrange.
There was a problem hiding this comment.
@jsuarezruiz the conversation was mark as resolved, but does not look like it was, can you please comment?
There was a problem hiding this comment.
You are right, with the current approach the height is infinity. However, with the return values from base.GetDesiredSize:
DesiredSize {Width=0 Height=4793480}
The EmptyView will not be visible using that values (zero Width).
|
| if (!double.IsInfinity(height)) | ||
| height = Context.ToPixels(height); | ||
|
|
||
| UpdateEmptyViewSize(width, height); |
There was a problem hiding this comment.
If the ItemsView measurement is unconstrained in one direction, won't that set the height or width of the EmptyViewAdapter's RecyclerViewWidth or RecyclerViewHeight to infinity? It seems like it should use the height returned from GetDesiredSize, not the measurement constraints.
hartez
left a comment
There was a problem hiding this comment.
Okay, looks like it's all working.
|
When is this fix released? |
At the moment, it's slated to be released as part of .NET 8. So it will likely be in the next .NET 8 preview. |
* Fix Android CollectionView EmptyView * Update src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Android.cs Co-authored-by: E.Z. Hart <hartez@users.noreply.github.com> * Fixed build errors * Auto-format source code --------- Co-authored-by: E.Z. Hart <hartez@users.noreply.github.com> Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>
|
Wow, I am surprised that it took 2 years to fix something that is one of the major functionalities of CollectionView, I remember facing this issue with .Net 6 and it's coming out with .Net 8, Damn... |
|
EmptyViewTemplate still does not render at all: #18551 |
Description of Change
Fix Android CollectionView EmptyView.
Issues Fixed
Fixes #10819