Piwigo / Piwigo-Android

Piwigo Native Android App
GNU General Public License v3.0
141 stars 43 forks source link

Photoviewer shows last image on tap #157

Closed ramack closed 4 years ago

ramack commented 4 years ago

Describe the bug and how to reproduce As soon as the activity once was refreshed (by sliding down, maybe also after upload) the Photoviewer will start with the last image in the album whatever picture was tapped on.

Valou447 commented 4 years ago

I already experienced this bug but did not figure out how to reproduce.

Thanks for the additional informations, I’ll take a closer look 😉

ramack commented 4 years ago

I guess it is related to AlbumsViewModel.java:216:imageId++; - meaning: binding the view shall not modify the state (imageId) as for sure the ViewModel will continoue to exist (by definition) even for recreating the activity - which will cause rebinding... I think the ImageId passed as parameter to ImagesItemViewModel should be something like images.indexOf(image)

Valou447 commented 4 years ago

Yes, this is related for sure, but yet I do not have a better solution for sure.. could you try to take a look ?