fix: text | reply bar not hiding
This commit is contained in:
parent
af1bc944d8
commit
385198e69a
4 changed files with 11 additions and 9 deletions
|
@ -130,12 +130,12 @@ class CommentItem(val comment: Comment,
|
|||
viewBinding.modBadge.visibility = if (comment.isMod == true) View.VISIBLE else View.GONE
|
||||
viewBinding.adminBadge.visibility = if (comment.isAdmin == true) View.VISIBLE else View.GONE
|
||||
viewBinding.commentDelete.setOnClickListener {
|
||||
dialogBuilder("Delete CommentNotificationWorker", "Are you sure you want to delete this comment?") {
|
||||
dialogBuilder("Delete Comment", "Are you sure you want to delete this comment?") {
|
||||
val scope = CoroutineScope(Dispatchers.Main + SupervisorJob())
|
||||
scope.launch {
|
||||
val success = CommentsAPI.deleteComment(comment.commentId)
|
||||
if (success) {
|
||||
snackString("CommentNotificationWorker Deleted")
|
||||
snackString("Comment Deleted")
|
||||
parentSection.remove(this@CommentItem)
|
||||
}
|
||||
}
|
||||
|
@ -153,12 +153,12 @@ class CommentItem(val comment: Comment,
|
|||
}
|
||||
}
|
||||
viewBinding.commentReport.setOnClickListener {
|
||||
dialogBuilder("Report CommentNotificationWorker", "Only report comments that violate the rules. Are you sure you want to report this comment?") {
|
||||
dialogBuilder("Report Comment", "Only report comments that violate the rules. Are you sure you want to report this comment?") {
|
||||
val scope = CoroutineScope(Dispatchers.Main + SupervisorJob())
|
||||
scope.launch {
|
||||
val success = CommentsAPI.reportComment(comment.commentId, comment.username, commentsFragment.mediaName, comment.userId)
|
||||
if (success) {
|
||||
snackString("CommentNotificationWorker Reported")
|
||||
snackString("Comment Reported")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -264,7 +264,7 @@ class CommentsFragment : Fragment() {
|
|||
300,
|
||||
activity.binding.commentInput.text.length
|
||||
)
|
||||
snackString("CommentNotificationWorker cannot be longer than 300 characters")
|
||||
snackString("Comment cannot be longer than 300 characters")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -475,6 +475,7 @@ class CommentsFragment : Fragment() {
|
|||
}
|
||||
|
||||
InteractionState.REPLY -> {
|
||||
activity.binding.commentReplyToContainer.visibility = View.GONE
|
||||
activity.binding.commentInput.setText("")
|
||||
val imm = activity.getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imm.hideSoftInputFromWindow(activity.binding.commentInput.windowToken, 0)
|
||||
|
@ -602,7 +603,7 @@ class CommentsFragment : Fragment() {
|
|||
private fun processComment() {
|
||||
val commentText = activity.binding.commentInput.text.toString()
|
||||
if (commentText.isEmpty()) {
|
||||
snackString("CommentNotificationWorker cannot be empty")
|
||||
snackString("Comment cannot be empty")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -619,6 +620,7 @@ class CommentsFragment : Fragment() {
|
|||
null
|
||||
)
|
||||
}
|
||||
resetOldState()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -638,7 +640,7 @@ class CommentsFragment : Fragment() {
|
|||
groups.forEach { item ->
|
||||
if (item is CommentItem && item.comment.commentId == commentWithInteraction?.comment?.commentId) {
|
||||
updateCommentItem(item, commentText)
|
||||
snackString("CommentNotificationWorker edited")
|
||||
snackString("Comment edited")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue