mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-10-05 13:29:50 +02:00
Don't autoplay spoiler videos.
This commit is contained in:
@@ -407,7 +407,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
switch (mPost.getPostType()) {
|
switch (mPost.getPostType()) {
|
||||||
case Post.VIDEO_TYPE:
|
case Post.VIDEO_TYPE:
|
||||||
if (mAutoplay && !mSeparatePostAndComments) {
|
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_AND_GIF_PREVIEW;
|
||||||
}
|
}
|
||||||
return VIEW_TYPE_POST_DETAIL_VIDEO_AUTOPLAY;
|
return VIEW_TYPE_POST_DETAIL_VIDEO_AUTOPLAY;
|
||||||
@@ -416,7 +416,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
}
|
}
|
||||||
case Post.GIF_TYPE:
|
case Post.GIF_TYPE:
|
||||||
if (mAutoplay) {
|
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_VIDEO_AND_GIF_PREVIEW;
|
||||||
}
|
}
|
||||||
return VIEW_TYPE_POST_DETAIL_GIF_AUTOPLAY;
|
return VIEW_TYPE_POST_DETAIL_GIF_AUTOPLAY;
|
||||||
|
@@ -350,7 +350,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
|||||||
switch (post.getPostType()) {
|
switch (post.getPostType()) {
|
||||||
case Post.VIDEO_TYPE:
|
case Post.VIDEO_TYPE:
|
||||||
if (mAutoplay) {
|
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_WITH_PREVIEW_TYPE;
|
||||||
}
|
}
|
||||||
return VIEW_TYPE_POST_CARD_VIDEO_AUTOPLAY_TYPE;
|
return VIEW_TYPE_POST_CARD_VIDEO_AUTOPLAY_TYPE;
|
||||||
@@ -399,7 +399,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
|||||||
switch (post.getPostType()) {
|
switch (post.getPostType()) {
|
||||||
case Post.VIDEO_TYPE:
|
case Post.VIDEO_TYPE:
|
||||||
if (mAutoplay) {
|
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_WITH_PREVIEW_TYPE;
|
||||||
}
|
}
|
||||||
return VIEW_TYPE_POST_CARD_2_VIDEO_AUTOPLAY_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;
|
Post.Preview preview = ((PostWithPreviewTypeViewHolder) holder).preview;
|
||||||
if (preview != null) {
|
if (preview != null) {
|
||||||
String url;
|
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) {
|
if (post.getPostType() == Post.GIF_TYPE && mAutoplay && !blurImage) {
|
||||||
url = post.getUrl();
|
url = post.getUrl();
|
||||||
} else {
|
} else {
|
||||||
@@ -1563,7 +1563,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
|||||||
Post.Preview preview = ((PostCard2WithPreviewViewHolder) holder).preview;
|
Post.Preview preview = ((PostCard2WithPreviewViewHolder) holder).preview;
|
||||||
if (preview != null) {
|
if (preview != null) {
|
||||||
String url;
|
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) {
|
if (post.getPostType() == Post.GIF_TYPE && mAutoplay && !blurImage) {
|
||||||
url = post.getUrl();
|
url = post.getUrl();
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user