diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-07-19 12:28:12 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-07-19 12:28:12 +0000 |
commit | 5924c921cfb1ed39b6cac5a101a85f7c4d08e1f5 (patch) | |
tree | 70c1a2da8dccb176715361475fccbd3fb5fc3845 /app/src/main/java/ml/docilealligator/infinityforreddit | |
parent | 3ce5664aea6a6c14580e3a56bd0cf9e40b04f46c (diff) | |
download | infinity-for-reddit-5924c921cfb1ed39b6cac5a101a85f7c4d08e1f5.tar infinity-for-reddit-5924c921cfb1ed39b6cac5a101a85f7c4d08e1f5.tar.gz infinity-for-reddit-5924c921cfb1ed39b6cac5a101a85f7c4d08e1f5.tar.bz2 infinity-for-reddit-5924c921cfb1ed39b6cac5a101a85f7c4d08e1f5.tar.lz infinity-for-reddit-5924c921cfb1ed39b6cac5a101a85f7c4d08e1f5.tar.xz infinity-for-reddit-5924c921cfb1ed39b6cac5a101a85f7c4d08e1f5.tar.zst infinity-for-reddit-5924c921cfb1ed39b6cac5a101a85f7c4d08e1f5.zip |
Fix sometimes images in a Reddit Gallery cannot be loaded.
Diffstat (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java index 476cfc8b..e3e06399 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java @@ -385,8 +385,21 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { } @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(); + } } } |