From 53755d438168f3830dba2dad9ae63d7262909fc3 Mon Sep 17 00:00:00 2001 From: Docile-Alligator Date: Sun, 6 Mar 2022 15:09:57 +0800 Subject: Version 5.1.9-beta1. Fix low resolution post previews when showing them for the first time in PostDetailRecyclerViewAdapter. --- app/build.gradle | 4 +-- .../adapters/MessageRecyclerViewAdapter.java | 8 +++--- .../adapters/PostDetailRecyclerViewAdapter.java | 33 +++++++++++++++++++--- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 548b70fa..779678fc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "ml.docilealligator.infinityforreddit" minSdkVersion 21 targetSdkVersion 30 - versionCode 93 - versionName "5.1.8" + versionCode 94 + versionName "5.1.9-beta1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" javaCompileOptions { annotationProcessorOptions { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/MessageRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/MessageRecyclerViewAdapter.java index d558d500..33add2f0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/MessageRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/MessageRecyclerViewAdapter.java @@ -187,7 +187,7 @@ public class MessageRecyclerViewAdapter extends PagedListAdapter { + holder.itemView.setOnClickListener(view -> { if (mMessageType == FetchMessage.MESSAGE_TYPE_INBOX && message.getContext() != null && !message.getContext().equals("")) { Uri uri = Uri.parse(message.getContext()); @@ -202,7 +202,7 @@ public class MessageRecyclerViewAdapter extends PagedListAdapter { if (((DataViewHolder) holder).contentCustomMarkwonView.getSelectionStart() == -1 && ((DataViewHolder) holder).contentCustomMarkwonView.getSelectionEnd() == -1) { - ((DataViewHolder) holder).itemView.performClick(); + holder.itemView.performClick(); } }); } 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 983c887a..1d72ec32 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java @@ -19,6 +19,7 @@ import android.text.util.Linkify; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.ViewTreeObserver; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.RelativeLayout; @@ -717,7 +718,13 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter