aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml/docilealligator/infinityforreddit
diff options
context:
space:
mode:
authorscria1000 <91804886+scria1000@users.noreply.github.com>2022-11-02 12:48:52 +0000
committerGitHub <noreply@github.com>2022-11-02 12:48:52 +0000
commit3815abec3654801b9cda1dfad510ca2c892487ae (patch)
tree12420f4073008cfb2094948b9a0be48a899d080f /app/src/main/java/ml/docilealligator/infinityforreddit
parent4bec3e09225e44b1320e77146a232630626841aa (diff)
downloadinfinity-for-reddit-3815abec3654801b9cda1dfad510ca2c892487ae.tar
infinity-for-reddit-3815abec3654801b9cda1dfad510ca2c892487ae.tar.gz
infinity-for-reddit-3815abec3654801b9cda1dfad510ca2c892487ae.tar.bz2
infinity-for-reddit-3815abec3654801b9cda1dfad510ca2c892487ae.tar.lz
infinity-for-reddit-3815abec3654801b9cda1dfad510ca2c892487ae.tar.xz
infinity-for-reddit-3815abec3654801b9cda1dfad510ca2c892487ae.tar.zst
infinity-for-reddit-3815abec3654801b9cda1dfad510ca2c892487ae.zip
Don't pick up hyperlink text as a link (#1182)
Diffstat (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/markdown/SpoilerAwareMovementMethod.java3
2 files changed, 4 insertions, 1 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 9c9e4411..1ad0ba21 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java
@@ -7,6 +7,7 @@ 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;
@@ -243,6 +244,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
textView.setTypeface(mActivity.contentTypeface);
}
textView.setTextColor(markdownColor);
+ textView.setHighlightColor(Color.TRANSPARENT);
textView.setOnLongClickListener(view -> {
if (textView.getSelectionStart() == -1 && textView.getSelectionEnd() == -1) {
CopyTextBottomSheetFragment.show(
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/SpoilerAwareMovementMethod.java b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/SpoilerAwareMovementMethod.java
index 19ab96f3..1b343e6a 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/SpoilerAwareMovementMethod.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/SpoilerAwareMovementMethod.java
@@ -66,7 +66,8 @@ public class SpoilerAwareMovementMethod extends BetterLinkMovementMethod {
private ClickableSpan selectClickableSpan(@NonNull Object[] spans) {
SpoilerSpan spoilerSpan = null;
ClickableSpan nonSpoilerSpan = null;
- for (final Object span : spans) {
+ for (int i = spans.length - 1; i >= 0; i--) {
+ final Object span = spans[i];
if (span instanceof SpoilerSpan) {
spoilerSpan = (SpoilerSpan) span;
} else if (span instanceof ClickableSpan) {