mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50: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(
|
||||
private val videoId: String,
|
||||
private val comments: MutableList<Comment>,
|
||||
private val isRepliesAdapter: Boolean = false
|
||||
private val isRepliesAdapter: Boolean = false,
|
||||
private val dismiss: () -> Unit
|
||||
) : RecyclerView.Adapter<CommentsViewHolder>() {
|
||||
|
||||
private var isLoading = false
|
||||
@ -80,14 +81,11 @@ class CommentsAdapter(
|
||||
|
||||
commentorImage.setOnClickListener {
|
||||
NavigationHelper.navigateChannel(root.context, comment.commentorUrl)
|
||||
dismiss.invoke()
|
||||
}
|
||||
|
||||
repliesRecView.layoutManager = LinearLayoutManager(root.context)
|
||||
val repliesAdapter = CommentsAdapter(
|
||||
videoId,
|
||||
mutableListOf(),
|
||||
true
|
||||
)
|
||||
val repliesAdapter = CommentsAdapter(videoId, mutableListOf(), true, dismiss)
|
||||
repliesRecView.adapter = repliesAdapter
|
||||
if (!isRepliesAdapter && comment.repliesPage != null) {
|
||||
root.setOnClickListener {
|
||||
|
@ -50,7 +50,9 @@ class CommentsSheet(
|
||||
}
|
||||
|
||||
private fun setCommentsAdapter(comments: MutableList<Comment>) {
|
||||
commentsAdapter = CommentsAdapter(videoId, comments)
|
||||
commentsAdapter = CommentsAdapter(videoId, comments) {
|
||||
dialog?.dismiss()
|
||||
}
|
||||
binding.optionsRecycler.adapter = commentsAdapter
|
||||
isLoading = false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user