diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-07-19 11:55:22 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-07-19 11:55:22 +0000 |
commit | 3ce5664aea6a6c14580e3a56bd0cf9e40b04f46c (patch) | |
tree | e5397da04e33c2d457fe827541955d49619be6cd /app/src | |
parent | 7e2a8d4782be539ae0a6b61f57fdf4dafc0a7fa9 (diff) | |
download | infinity-for-reddit-3ce5664aea6a6c14580e3a56bd0cf9e40b04f46c.tar infinity-for-reddit-3ce5664aea6a6c14580e3a56bd0cf9e40b04f46c.tar.gz infinity-for-reddit-3ce5664aea6a6c14580e3a56bd0cf9e40b04f46c.tar.bz2 infinity-for-reddit-3ce5664aea6a6c14580e3a56bd0cf9e40b04f46c.tar.lz infinity-for-reddit-3ce5664aea6a6c14580e3a56bd0cf9e40b04f46c.tar.xz infinity-for-reddit-3ce5664aea6a6c14580e3a56bd0cf9e40b04f46c.tar.zst infinity-for-reddit-3ce5664aea6a6c14580e3a56bd0cf9e40b04f46c.zip |
Clear ImageView in onDestroyView in ViewRedditGalleryImageOrGifFragment and ViewImgurImageFragment.
Diffstat (limited to '')
4 files changed, 10 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java index c16cef7d..aee7b0fd 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java @@ -273,6 +273,7 @@ public class ViewImgurMediaActivity extends AppCompatActivity implements SetAsWa } }); viewPager.setAdapter(sectionsPagerAdapter); + viewPager.setOffscreenPageLimit(3); } private void setToolbarTitle(int position) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java index 267bd56b..52a02e44 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java @@ -128,6 +128,7 @@ public class ViewRedditGalleryActivity extends AppCompatActivity implements SetA } }); viewPager.setAdapter(sectionsPagerAdapter); + viewPager.setOffscreenPageLimit(3); } private void setToolbarTitle(int position) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java index 973b0cee..d4d8c877 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java @@ -269,4 +269,10 @@ public class ViewImgurImageFragment extends Fragment { super.onAttach(context); activity = (ViewImgurMediaActivity) context; } + + @Override + public void onDestroyView() { + super.onDestroyView(); + glide.clear(imageView); + } } 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 89a99a39..476cfc8b 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,8 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { } @Override - public void onDestroy() { - super.onDestroy(); + public void onDestroyView() { + super.onDestroyView(); BigImageViewer.imageLoader().cancelAll(); } } |