diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-12-03 13:16:15 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-12-03 13:16:15 +0000 |
commit | 45f4fae786086813c1a33295e6aae02ce7679b1a (patch) | |
tree | eda546cfe5214e017929d9373afc4c97c9c0ea14 /app/src | |
parent | c809de6350872de2b376892bf10bf48a8931d321 (diff) | |
download | infinity-for-reddit-45f4fae786086813c1a33295e6aae02ce7679b1a.tar infinity-for-reddit-45f4fae786086813c1a33295e6aae02ce7679b1a.tar.gz infinity-for-reddit-45f4fae786086813c1a33295e6aae02ce7679b1a.tar.bz2 infinity-for-reddit-45f4fae786086813c1a33295e6aae02ce7679b1a.tar.lz infinity-for-reddit-45f4fae786086813c1a33295e6aae02ce7679b1a.tar.xz infinity-for-reddit-45f4fae786086813c1a33295e6aae02ce7679b1a.tar.zst infinity-for-reddit-45f4fae786086813c1a33295e6aae02ce7679b1a.zip |
Fix gallery post preview still shows in ViewPostDetailActivity when Disable Image Preview in Data Saving Mode is enabled.
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java | 14 |
1 files changed, 5 insertions, 9 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 97ea961d..b436a1ec 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java @@ -7,17 +7,13 @@ import android.content.SharedPreferences; import android.content.res.ColorStateList; import android.content.res.Configuration; import android.content.res.Resources; -import android.graphics.Color; import android.graphics.ColorFilter; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.os.Handler; -import android.text.SpannableStringBuilder; import android.text.Spanned; -import android.text.TextPaint; -import android.text.style.ClickableSpan; import android.text.util.Linkify; import android.view.LayoutInflater; import android.view.View; @@ -55,8 +51,6 @@ import org.commonmark.ext.gfm.tables.TableBlock; import java.util.ArrayList; import java.util.Locale; import java.util.concurrent.Executor; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import butterknife.BindView; import butterknife.ButterKnife; @@ -87,9 +81,9 @@ import jp.wasabeef.glide.transformations.BlurTransformation; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; import me.saket.bettermovementmethod.BetterLinkMovementMethod; import ml.docilealligator.infinityforreddit.FetchGfycatOrRedgifsVideoLinks; -import ml.docilealligator.infinityforreddit.SaveMemoryCenterInisdeDownsampleStrategy; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; +import ml.docilealligator.infinityforreddit.SaveMemoryCenterInisdeDownsampleStrategy; import ml.docilealligator.infinityforreddit.SaveThing; import ml.docilealligator.infinityforreddit.VoteThing; import ml.docilealligator.infinityforreddit.activities.CommentActivity; @@ -112,12 +106,11 @@ import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFi import ml.docilealligator.infinityforreddit.customviews.MarkwonLinearLayoutManager; import ml.docilealligator.infinityforreddit.fragments.ViewPostDetailFragment; import ml.docilealligator.infinityforreddit.markdown.SpoilerParserPlugin; -import ml.docilealligator.infinityforreddit.markdown.SpoilerSpan; +import ml.docilealligator.infinityforreddit.markdown.SuperscriptInlineProcessor; import ml.docilealligator.infinityforreddit.post.Post; import ml.docilealligator.infinityforreddit.post.PostPagingSource; import ml.docilealligator.infinityforreddit.utils.APIUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; -import ml.docilealligator.infinityforreddit.markdown.SuperscriptInlineProcessor; import ml.docilealligator.infinityforreddit.utils.Utils; import pl.droidsonroids.gif.GifImageView; import retrofit2.Retrofit; @@ -459,6 +452,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler case VIEW_TYPE_POST_DETAIL_NO_PREVIEW_LINK: return new PostDetailNoPreviewViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_detail_no_preview, parent, false)); case VIEW_TYPE_POST_DETAIL_GALLERY: + if (mDataSavingMode && mDisableImagePreview) { + return new PostDetailNoPreviewViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_detail_no_preview, parent, false)); + } return new PostDetailGalleryViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_detail_gallery, parent, false)); default: return new PostDetailTextViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_detail_text, parent, false)); |