aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-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) {