michaeltroger / greenpass-android

Green Pass PDF Wallet Android App
https://play.google.com/store/apps/details?id=com.michaeltroger.gruenerpass
GNU General Public License v3.0
78 stars 3 forks source link

[BUG] Scrolling through document with many pages shows unexpected page order shortly #253

Closed michaeltroger closed 6 months ago

michaeltroger commented 6 months ago

Describe the bug When scrolling through a PDF document with lots of pages quickly, then for a little while the wrong page content is displayed.

To Reproduce Steps to reproduce the behavior:

  1. Add a document with plenty of pages (e.g. 50)
  2. Scroll down towards the last page
  3. Quickly scroll up again towards the first page
  4. You see a wrong page content (not in expected order) for a second or so, before the correct page content loads, fitting to the current position

Expected behavior You should either see the correct page content right away or a loading indicator, before the correct page can be shown

Screenshots x

Smartphone (please complete the following information):

Additional context This is most likely due to the way views are re-used in RecyclerViews. One idea to solve it is to remove the page content (the ImageView) after scrolling away and showing the loading indicator once more. Another idea could be to cache the pages so that they can be loaded quicker