diff options
author | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-05-07 14:55:22 +0000 |
---|---|---|
committer | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-05-07 14:55:22 +0000 |
commit | 1bcbbbecc932c0572b376ab47b52ebe3850b90d3 (patch) | |
tree | 7fa42643b01de247f1338af6433b890bb04b8e04 /app/src/main/java/ml/docilealligator/infinityforreddit | |
parent | a288a638b5d08b77e16a6679fa2de5653e434a13 (diff) | |
download | infinity-for-reddit-1bcbbbecc932c0572b376ab47b52ebe3850b90d3.tar infinity-for-reddit-1bcbbbecc932c0572b376ab47b52ebe3850b90d3.tar.gz infinity-for-reddit-1bcbbbecc932c0572b376ab47b52ebe3850b90d3.tar.bz2 infinity-for-reddit-1bcbbbecc932c0572b376ab47b52ebe3850b90d3.tar.lz infinity-for-reddit-1bcbbbecc932c0572b376ab47b52ebe3850b90d3.tar.xz infinity-for-reddit-1bcbbbecc932c0572b376ab47b52ebe3850b90d3.tar.zst infinity-for-reddit-1bcbbbecc932c0572b376ab47b52ebe3850b90d3.zip |
Fix https://github.com/Docile-Alligator/Infinity-For-Reddit/issues/1456
Diffstat (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java | 26 |
1 files changed, 16 insertions, 10 deletions
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<RecyclerVi } else { ((CommentViewHolder) holder).scoreTextView.setText(mActivity.getString(R.string.vote)); } - - if(comment.isEdited()){ - ((CommentViewHolder) holder).editedView.setText(R.string.edited); - ((CommentViewHolder) holder).editedView.setOnClickListener(view -> { - 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<RecyclerVi @BindView(R.id.comment_markdown_view_item_post_comment) RecyclerView commentMarkdownView; @BindView(R.id.edited_text_view_item_post_comment) - TextView editedView; + TextView editedTextView; @BindView(R.id.bottom_constraint_layout_item_post_comment) ConstraintLayout bottomConstraintLayout; @BindView(R.id.up_vote_button_item_post_comment) @@ -1318,6 +1314,16 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi authorFlairTextView.setOnClickListener(view -> 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); |