aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2022-02-05 07:32:01 +0000
committerAlex Ning <chineseperson5@gmail.com>2022-02-05 07:32:01 +0000
commit79cc6ddf1ee979d9a5c3cac2d426bf94813cef1f (patch)
tree85cdbe5d370c8953dff2729dbdf527a2adf6a9da
parentc265bbecf9b613285de56cd0643ec94e364d4f5e (diff)
downloadinfinity-for-reddit-79cc6ddf1ee979d9a5c3cac2d426bf94813cef1f.tar
infinity-for-reddit-79cc6ddf1ee979d9a5c3cac2d426bf94813cef1f.tar.gz
infinity-for-reddit-79cc6ddf1ee979d9a5c3cac2d426bf94813cef1f.tar.bz2
infinity-for-reddit-79cc6ddf1ee979d9a5c3cac2d426bf94813cef1f.tar.lz
infinity-for-reddit-79cc6ddf1ee979d9a5c3cac2d426bf94813cef1f.tar.xz
infinity-for-reddit-79cc6ddf1ee979d9a5c3cac2d426bf94813cef1f.tar.zst
infinity-for-reddit-79cc6ddf1ee979d9a5c3cac2d426bf94813cef1f.zip
Don't autoplay spoiler videos.
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java4
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java8
2 files changed, 6 insertions, 6 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java
index a59f2dc1..954853f1 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java
@@ -407,7 +407,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
switch (mPost.getPostType()) {
case Post.VIDEO_TYPE:
if (mAutoplay && !mSeparatePostAndComments) {
- if (!mAutoplayNsfwVideos && mPost.isNSFW()) {
+ if ((!mAutoplayNsfwVideos && mPost.isNSFW()) || mPost.isSpoiler()) {
return VIEW_TYPE_POST_DETAIL_VIDEO_AND_GIF_PREVIEW;
}
return VIEW_TYPE_POST_DETAIL_VIDEO_AUTOPLAY;
@@ -416,7 +416,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
}
case Post.GIF_TYPE:
if (mAutoplay) {
- if (!mAutoplayNsfwVideos && mPost.isNSFW()) {
+ if ((!mAutoplayNsfwVideos && mPost.isNSFW()) || mPost.isSpoiler()) {
return VIEW_TYPE_POST_DETAIL_VIDEO_AND_GIF_PREVIEW;
}
return VIEW_TYPE_POST_DETAIL_GIF_AUTOPLAY;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
index df842ad4..2bc5c5df 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
@@ -350,7 +350,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
switch (post.getPostType()) {
case Post.VIDEO_TYPE:
if (mAutoplay) {
- if (!mAutoplayNsfwVideos && post.isNSFW()) {
+ if ((!mAutoplayNsfwVideos && post.isNSFW()) || post.isSpoiler()) {
return VIEW_TYPE_POST_CARD_WITH_PREVIEW_TYPE;
}
return VIEW_TYPE_POST_CARD_VIDEO_AUTOPLAY_TYPE;
@@ -399,7 +399,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
switch (post.getPostType()) {
case Post.VIDEO_TYPE:
if (mAutoplay) {
- if (!mAutoplayNsfwVideos && post.isNSFW()) {
+ if ((!mAutoplayNsfwVideos && post.isNSFW()) || post.isSpoiler()) {
return VIEW_TYPE_POST_CARD_2_WITH_PREVIEW_TYPE;
}
return VIEW_TYPE_POST_CARD_2_VIDEO_AUTOPLAY_TYPE;
@@ -1503,7 +1503,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
Post.Preview preview = ((PostWithPreviewTypeViewHolder) holder).preview;
if (preview != null) {
String url;
- boolean blurImage = (post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(post.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || post.isSpoiler() && mNeedBlurSpoiler;
+ boolean blurImage = (post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(post.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || (post.isSpoiler() && mNeedBlurSpoiler);
if (post.getPostType() == Post.GIF_TYPE && mAutoplay && !blurImage) {
url = post.getUrl();
} else {
@@ -1563,7 +1563,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
Post.Preview preview = ((PostCard2WithPreviewViewHolder) holder).preview;
if (preview != null) {
String url;
- boolean blurImage = (post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(post.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || post.isSpoiler() && mNeedBlurSpoiler;
+ boolean blurImage = (post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(post.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || (post.isSpoiler() && mNeedBlurSpoiler);
if (post.getPostType() == Post.GIF_TYPE && mAutoplay && !blurImage) {
url = post.getUrl();
} else {