commons-app / apps-android-commons

The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons
https://commons-app.github.io/
Apache License 2.0
1.01k stars 1.19k forks source link

[Bug]: Preview picture in custom picker is waaay too slow #5789

Open mnalis opened 1 month ago

mnalis commented 1 month ago

Summary

Not only is picture preview in Custom Picker lacking in zoom (see https://github.com/commons-app/apps-android-commons/issues/5701), it is also annoying slow to display the picture.

Perhaps we could just call external default gallery/image viewer app (via intent) to display that picture on long-press? That would be much faster, fix the related zoom bug, give user the choice, and probably reduce the code.

(Or at least use some reasonable library / implementation instead of whatever is being used currently.)

Steps to reproduce

  1. Open Commons app
  2. choose + to add picture, and choose 3rd option (Custom selector)
  3. long press on some picture to preview it

Expected behaviour

Picture displays immediately (on this class of hardware!), just like it does in any other picture viewer (stock gallery, Fossify Gallery, Ghost Commander viewer...) i.e. under 0.1 seconds

Actual behaviour

spinner appears and spins for more than 2 seconds before picture is shown. That is more than 20 times (2000% !) slower than normal!

Device name

Samsung Galaxy S23+

Android version

Android 14 (OneUI 6.1)

Commons app version

5.0.2 (latest F-droid)

Device logs

No response

Screen-shots

Video showing how slow Commons app is when displaying image, compared to e.g. Fossify Gallery (which also is able to do much bigger zoom):

https://github.com/user-attachments/assets/2108780d-1123-4581-a65f-2760efa307c0

To add the insult to the injury, the viewer code does fancy fade-in effect, thus making picture display intentionally slower by some 0.2 seconds or so more...

Would you like to work on the issue?

None

rohit9625 commented 1 month ago

I am working on migrating the custom picker to Jetpack Compose and it'll solve this and more related problems.

mnalis commented 1 month ago

That sounds great @rohit9625; please do link it here when when you have some draft PR!