feat(comments): re-added Divider for reply

This commit is contained in:
aayush262 2024-02-20 14:11:38 +05:30
parent 84ae520f93
commit b2f01a24b2
2 changed files with 31 additions and 10 deletions

View file

@ -55,18 +55,25 @@ class CommentItem(val comment: Comment,
viewBinding.commentEdit.visibility = if (isUserComment) View.VISIBLE else View.GONE
if ((comment.replyCount ?: 0) > 0) {
viewBinding.commentTotalReplies.visibility = View.VISIBLE
viewBinding.commentRepliesDivider.visibility = View.VISIBLE
viewBinding.commentTotalReplies.text = "View ${comment.replyCount} repl${if (comment.replyCount == 1) "y" else "ies"}"
} else {
viewBinding.commentTotalReplies.visibility = View.GONE
viewBinding.commentRepliesDivider.visibility = View.GONE
}
viewBinding.commentReply.visibility = View.VISIBLE
viewBinding.commentTotalReplies.setOnClickListener {
viewBinding.commentTotalReplies.visibility = View.GONE
viewBinding.commentRepliesDivider.visibility = View.GONE
viewReplyCallback(this)
}
viewBinding.commentUserName.setOnClickListener {
openLinkInBrowser("https://anilist.co/user/${comment.username}")
}
viewBinding.commentText.setOnLongClickListener {
copyToClipboard(comment.content)
true
}
var isEditing = false
var isReplying = false
viewBinding.commentEdit.setOnClickListener {

View file

@ -186,7 +186,19 @@
tools:ignore="ContentDescription" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<View
android:id="@+id/commentRepliesDivider"
android:layout_width="32dp"
android:layout_height="3dp"
android:layout_gravity="center"
android:layout_marginStart="44dp"
android:background="@color/nav_tab" />
<TextView
android:id="@+id/commentTotalReplies"
android:layout_width="wrap_content"
@ -198,6 +210,8 @@
android:textSize="12sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/commentRepliesList"
android:layout_width="match_parent"