unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
9.09k stars 739 forks source link

[Skia|Android] ItemsRepeater fails to layout items when navigated back again #11626

Open FrozDark opened 1 year ago

FrozDark commented 1 year ago

Current behavior

When navigating to an existing (cached) page with ItemsRepeater it stops layouting items that were out of scope while scrolling

agaga

Android issue happens if you try to manipulate with the collection. When you remove items or clear it doesn't remove items visually but touching it removes. Adding new items doesn't layout new items at all. So if you clear the collection it stays empty visually. Tested on 4.8.15 stable

Expected behavior

Layout items as it should

How to reproduce it (as minimally and precisely as possible)

  1. Run a Skia project in the repro
  2. Click on "Go" button in the toolbars
  3. Wait for navigations done
  4. Scroll up or down

Repro: ItemsRepeaterIssue.zip

Workaround

Skia: Force layout by changing size of window or refresh ItemsSource

Android: Reset ItemsSource

Works on UWP/WinUI

Yes

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

No response

Affected platforms

Skia (WPF), Skia (GTK on Linux/macOS/Windows), Skia (Linux Framebuffer), Skia (Tizen)

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

GTK have the same issue as well so I suppose that every Skia project is having that issue

FrozDark commented 1 year ago

Seems like Android have a little different issue with layouting items but might be related to as well

Android issue happens if you try to manipulate with the collection. When you remove items or clear it doesn't remove items visually but touching it removes. Then adding new items doesn't layout new items at all. So if you clear the collection it stays clear visually. Tested on 4.8.15 stable