Fix sometimes images in a Reddit Gallery cannot be loaded.

This commit is contained in:
Alex Ning 2021-07-19 20:28:12 +08:00
parent 3ce5664aea
commit 5924c921cf

View File

@ -384,9 +384,22 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment {
activity = (ViewRedditGalleryActivity) context; activity = (ViewRedditGalleryActivity) context;
} }
@Override
public void onResume() {
super.onResume();
SubsamplingScaleImageView ssiv = imageView.getSSIV();
if (ssiv == null || !ssiv.hasImage()) {
imageView.showImage(Uri.parse(media.url));
}
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
BigImageViewer.imageLoader().cancelAll(); BigImageViewer.imageLoader().cancelAll();
SubsamplingScaleImageView subsamplingScaleImageView = imageView.getSSIV();
if (subsamplingScaleImageView != null) {
subsamplingScaleImageView.recycle();
}
} }
} }