Skip to content

Commit

Permalink
Fix no automatically scrolling bug
Browse files Browse the repository at this point in the history
The process of loading image is finish, but the media item is null.

When the media item is null, resume the photoDataAdapter.

Change-Id: I7035121000439aac40f484af79b36617aff039e0
  • Loading branch information
lihai authored and usmcamgrimm committed Mar 24, 2018
1 parent 510359e commit d757a17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/com/android/gallery3d/app/PhotoPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,11 @@ public void onPhotoChanged(int index, Path item) {
public void onLoadingFinished(boolean loadingFailed) {
if (!mModel.isEmpty()) {
MediaItem photo = mModel.getMediaItem(0);
if (photo != null) updateCurrentPhoto(photo);
if (photo != null) {
updateCurrentPhoto(photo);
} else {
mModel.resume();
}
} else if (mIsActive) {
// We only want to finish the PhotoPage if there is no
// deletion that the user can undo.
Expand Down

0 comments on commit d757a17

Please sign in to comment.