Repository navigation
[Android] Improve CollectionView scrolling (Shadows) - #10523
jsuarezruiz wants to merge 12 commits into
Conversation
Do you have any data to show this improves scrolling speed? It doesn't seem like it would have any bearing on the scrolling, since it doesn't happen until the CollectionView is being disposed (or the ItemsSource changes). The shadow caching portion may help with the scrolling speed, but I'm suspicious of the other changes. This should be two separate PRs so we can evaluate each one independently. |
|
|
||
| public Bitmap Add(string id, Func<Bitmap> create) | ||
| { | ||
| Debug.WriteLine($"Add {id}"); |
There was a problem hiding this comment.
Left a debugging statement in there.
| internal class ShadowCache : IDisposable | ||
| { | ||
| static ShadowCache _instance; | ||
| readonly Dictionary<string, BitmapReference> _cache; |
There was a problem hiding this comment.
Rather than all this custom code, can this be done with a ConcurrentDictionary?
|
Converted back to Draft. Rebasing and testing everything, something has changed in this time and it doesn't work as expected. I will review everything to know what changed. |
|
The approach is good but we will reopen it with a different implementation. |
Description of Change
This PR include changes to:
With these changes, the scroll behavior passes from unusable to something much better, but jittering is still noticeable. We still MUST continue reviewing samples, debugging and improving to offer the best possible experience with the CollectionView.
To test the changes, navigate to the shadows gallery and select the benchmark page. Scroll the CollectionView for example until the item 50 and check in the Output that the shadow cache only contains 2 bitmaps.
NOTE: The gray color around the circular play button is a Shadow.
More changes related with CollectionView https://github.com/dotnet/maui/pull/10590/files
Issues Fixed
Fixes #9485