Fix layout bug: InvalidateMeasure the parent container as a recycled element is placed into it #312
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.
Imagine the datasource is reconfigured, causing the same elements to be displayed but they can end up different sizes.
(i.e. having a tree with children, then moving to a flat layout)
when you go from one layout to the next, the recycled cells may now have a different size, except they do not get re-measured / arranged (I assume for performance issues?)
This can cause many many layout issues that I have seen in various projects that use this.
This fix, invalidates the parent container, only if an item is being recycled.
I couldnt detect any noticable performance degradation in my app or in the sample app.
This fix is a catch all solution, and will get rid of the bug in all scenarios (I expect)
Another approach, might be to clear the cache of recycled elements if the datasource is changed.
(this would possibly fix my use case, but I know of other people who have this issue and it would not fix the issue for them)