feat(comments): re-added Divider for reply
This commit is contained in:
parent
84ae520f93
commit
b2f01a24b2
2 changed files with 31 additions and 10 deletions
|
@ -55,18 +55,25 @@ class CommentItem(val comment: Comment,
|
||||||
viewBinding.commentEdit.visibility = if (isUserComment) View.VISIBLE else View.GONE
|
viewBinding.commentEdit.visibility = if (isUserComment) View.VISIBLE else View.GONE
|
||||||
if ((comment.replyCount ?: 0) > 0) {
|
if ((comment.replyCount ?: 0) > 0) {
|
||||||
viewBinding.commentTotalReplies.visibility = View.VISIBLE
|
viewBinding.commentTotalReplies.visibility = View.VISIBLE
|
||||||
|
viewBinding.commentRepliesDivider.visibility = View.VISIBLE
|
||||||
viewBinding.commentTotalReplies.text = "View ${comment.replyCount} repl${if (comment.replyCount == 1) "y" else "ies"}"
|
viewBinding.commentTotalReplies.text = "View ${comment.replyCount} repl${if (comment.replyCount == 1) "y" else "ies"}"
|
||||||
} else {
|
} else {
|
||||||
viewBinding.commentTotalReplies.visibility = View.GONE
|
viewBinding.commentTotalReplies.visibility = View.GONE
|
||||||
|
viewBinding.commentRepliesDivider.visibility = View.GONE
|
||||||
}
|
}
|
||||||
viewBinding.commentReply.visibility = View.VISIBLE
|
viewBinding.commentReply.visibility = View.VISIBLE
|
||||||
viewBinding.commentTotalReplies.setOnClickListener {
|
viewBinding.commentTotalReplies.setOnClickListener {
|
||||||
viewBinding.commentTotalReplies.visibility = View.GONE
|
viewBinding.commentTotalReplies.visibility = View.GONE
|
||||||
|
viewBinding.commentRepliesDivider.visibility = View.GONE
|
||||||
viewReplyCallback(this)
|
viewReplyCallback(this)
|
||||||
}
|
}
|
||||||
viewBinding.commentUserName.setOnClickListener {
|
viewBinding.commentUserName.setOnClickListener {
|
||||||
openLinkInBrowser("https://anilist.co/user/${comment.username}")
|
openLinkInBrowser("https://anilist.co/user/${comment.username}")
|
||||||
}
|
}
|
||||||
|
viewBinding.commentText.setOnLongClickListener {
|
||||||
|
copyToClipboard(comment.content)
|
||||||
|
true
|
||||||
|
}
|
||||||
var isEditing = false
|
var isEditing = false
|
||||||
var isReplying = false
|
var isReplying = false
|
||||||
viewBinding.commentEdit.setOnClickListener {
|
viewBinding.commentEdit.setOnClickListener {
|
||||||
|
|
|
@ -186,7 +186,19 @@
|
||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</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
|
<TextView
|
||||||
android:id="@+id/commentTotalReplies"
|
android:id="@+id/commentTotalReplies"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -198,6 +210,8 @@
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
tools:ignore="HardcodedText" />
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/commentRepliesList"
|
android:id="@+id/commentRepliesList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue