Conversation
PureWeen
commented
May 7, 2024
| } | ||
|
|
||
| _reportMeasure?.Invoke(new Size(pixelWidth, pixelHeight)); | ||
| _reportMeasure = null; // Make sure we only report back the measure once |
Member
Author
There was a problem hiding this comment.
We can't really set this to null because if the constraints on the CV change we need to report a new measure.
jsuarezruiz
reviewed
May 8, 2024
|
|
||
| button.Clicked += (_, _) => | ||
| { | ||
| if (cv.WidthRequest == 200) |
Contributor
There was a problem hiding this comment.
Could we update the sample to use the Page Width? In this way, we can validate with an UITest the UI rotating the device.
Member
Author
There was a problem hiding this comment.
Yea, that's caused by this unfortunately
#22271
Contributor
jsuarezruiz
approved these changes
May 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Description of Change
When the constraints of a RecyclerView change, the items don't get recreated so we have to re-evaluate the cached sizes being used to measure each of the items. The way the code was setup it would only set the static size once and then reuse that no matter what the change are.
My current overall thinking here is that
ItemSizingStrategyis somewhat pointless on android as it relates to performance. The only reason to use it would be if you want the first item to set the measure for the rest of your cells. Generally, if you want the best performance, and you want all the cells to be the same size, then just set a specific height/width on your cells.For example, if you just remove all of our custom measuring code inside ItemContentView and just rely on the "LayoutParams" to size the elements it all measures naturally.
I think there are some additional issues related to messages getting propagated to the handlers
#22271
But we'll look at that as part of SR6
Issues Fixed
Fixes #21967