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); diff --git a/app/src/main/res/layout/item_comment.xml b/app/src/main/res/layout/item_comment.xml index cfe48e6f..9889ca5a 100644 --- a/app/src/main/res/layout/item_comment.xml +++ b/app/src/main/res/layout/item_comment.xml @@ -75,7 +75,9 @@ android:layout_marginEnd="8dp" android:fontFamily="?attr/font_family" android:gravity="end" + android:text="@string/edited" android:textSize="?attr/font_default" + android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@id/top_score_text_view_item_post_comment" app:layout_constraintTop_toTopOf="parent" />