From 1bcbbbecc932c0572b376ab47b52ebe3850b90d3 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Sun, 7 May 2023 22:55:22 +0800 Subject: Fix https://github.com/Docile-Alligator/Infinity-For-Reddit/issues/1456 --- .../adapters/CommentsRecyclerViewAdapter.java | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'app/src/main/java/ml') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java index fa34151b..41239401 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java @@ -459,15 +459,11 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter { - Toast.makeText(view.getContext(), view.getContext().getString(R.string.edited_time, mShowElapsedTime ? - Utils.getElapsedTime(mActivity, comment.getEditedTimeMillis()) : - Utils.getFormattedTime(mLocale, comment.getEditedTimeMillis(), mTimeFormatPattern) - ), Toast.LENGTH_SHORT).show(); - }); + + if (comment.isEdited()) { + ((CommentViewHolder) holder).editedTextView.setVisibility(View.VISIBLE); + } else { + ((CommentViewHolder) holder).editedTextView.setVisibility(View.GONE); } ((CommentViewHolder) holder).commentIndentationView.setShowOnlyOneDivider(mShowOnlyOneCommentLevelIndicator); @@ -1192,7 +1188,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter authorTextView.performClick()); + editedTextView.setOnClickListener(view -> { + Comment comment = getCurrentComment(this); + if (comment != null) { + Toast.makeText(view.getContext(), view.getContext().getString(R.string.edited_time, mShowElapsedTime ? + Utils.getElapsedTime(mActivity, comment.getEditedTimeMillis()) : + Utils.getFormattedTime(mLocale, comment.getEditedTimeMillis(), mTimeFormatPattern) + ), Toast.LENGTH_SHORT).show(); + } + }); + moreButton.setOnClickListener(view -> { getItemCount(); Comment comment = getCurrentComment(this); -- cgit v1.2.3