maui icon indicating copy to clipboard operation
maui copied to clipboard

Trigger remeasure when constraints on CV changes

Open PureWeen opened this issue 1 year ago • 0 comments

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 ItemSizingStrategy is 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 https://github.com/dotnet/maui/issues/22271

But we'll look at that as part of SR6

Issues Fixed

Fixes #21967

PureWeen avatar May 07 '24 15:05 PureWeen