mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
dismiss the comments sheet when clicking a channel avatar
This commit is contained in:
parent
ee4581f2e3
commit
998cf38e6b
@ -29,7 +29,8 @@ import kotlinx.coroutines.withContext
|
|||||||
class CommentsAdapter(
|
class CommentsAdapter(
|
||||||
private val videoId: String,
|
private val videoId: String,
|
||||||
private val comments: MutableList<Comment>,
|
private val comments: MutableList<Comment>,
|
||||||
private val isRepliesAdapter: Boolean = false
|
private val isRepliesAdapter: Boolean = false,
|
||||||
|
private val dismiss: () -> Unit
|
||||||
) : RecyclerView.Adapter<CommentsViewHolder>() {
|
) : RecyclerView.Adapter<CommentsViewHolder>() {
|
||||||
|
|
||||||
private var isLoading = false
|
private var isLoading = false
|
||||||
@ -80,14 +81,11 @@ class CommentsAdapter(
|
|||||||
|
|
||||||
commentorImage.setOnClickListener {
|
commentorImage.setOnClickListener {
|
||||||
NavigationHelper.navigateChannel(root.context, comment.commentorUrl)
|
NavigationHelper.navigateChannel(root.context, comment.commentorUrl)
|
||||||
|
dismiss.invoke()
|
||||||
}
|
}
|
||||||
|
|
||||||
repliesRecView.layoutManager = LinearLayoutManager(root.context)
|
repliesRecView.layoutManager = LinearLayoutManager(root.context)
|
||||||
val repliesAdapter = CommentsAdapter(
|
val repliesAdapter = CommentsAdapter(videoId, mutableListOf(), true, dismiss)
|
||||||
videoId,
|
|
||||||
mutableListOf(),
|
|
||||||
true
|
|
||||||
)
|
|
||||||
repliesRecView.adapter = repliesAdapter
|
repliesRecView.adapter = repliesAdapter
|
||||||
if (!isRepliesAdapter && comment.repliesPage != null) {
|
if (!isRepliesAdapter && comment.repliesPage != null) {
|
||||||
root.setOnClickListener {
|
root.setOnClickListener {
|
||||||
|
@ -50,7 +50,9 @@ class CommentsSheet(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setCommentsAdapter(comments: MutableList<Comment>) {
|
private fun setCommentsAdapter(comments: MutableList<Comment>) {
|
||||||
commentsAdapter = CommentsAdapter(videoId, comments)
|
commentsAdapter = CommentsAdapter(videoId, comments) {
|
||||||
|
dialog?.dismiss()
|
||||||
|
}
|
||||||
binding.optionsRecycler.adapter = commentsAdapter
|
binding.optionsRecycler.adapter = commentsAdapter
|
||||||
isLoading = false
|
isLoading = false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user