From 44a4fa16dc4ba24a68c81bc3abfbc16e97923c9c Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 17 Aug 2020 11:27:02 +0800 Subject: [PATCH] Fix spoiler overlap with onClickListener in CommentsListingRecyclerViewAdapter. Fix spoiler text color in comments in CommentAndPostRecyclerViewAdapter. --- .../CommentAndPostRecyclerViewAdapter.java | 6 +++--- .../CommentsListingRecyclerViewAdapter.java | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java index c63ba1e2..4e1baff3 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java @@ -242,6 +242,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter 0)) { - isShowing = !isShowing; - view.invalidate(); - } + isShowing = !isShowing; + view.invalidate(); } }; markdownStringBuilder.setSpan(clickableSpan, matcherStart, matcherEnd - 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); @@ -315,8 +313,11 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter - ((CommentViewHolder) holder).linearLayout.callOnClick()); + ((CommentViewHolder) holder).commentMarkdownView.setOnClickListener(view -> { + if (((CommentViewHolder) holder).commentMarkdownView.getSelectionStart() == -1 && ((CommentViewHolder) holder).commentMarkdownView.getSelectionEnd() == -1) { + ((CommentViewHolder) holder).linearLayout.callOnClick(); + } + }); ((CommentViewHolder) holder).upvoteButton.setOnClickListener(view -> { if (mAccessToken == null) { @@ -607,6 +608,8 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter