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;
}
@Override
public void onResume() {
super.onResume();
SubsamplingScaleImageView ssiv = imageView.getSSIV();
if (ssiv == null || !ssiv.hasImage()) {
imageView.showImage(Uri.parse(media.url));
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
BigImageViewer.imageLoader().cancelAll();
SubsamplingScaleImageView subsamplingScaleImageView = imageView.getSSIV();
if (subsamplingScaleImageView != null) {
subsamplingScaleImageView.recycle();
}
}
}