mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
limit the max height of the comments sheet
This commit is contained in:
parent
03973bcc14
commit
ea72e777c1
@ -327,7 +327,12 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.commentsToggle.setOnClickListener {
|
binding.commentsToggle.setOnClickListener {
|
||||||
CommentsSheet(videoId!!, comments, commentsNextPage) { comments, nextPage ->
|
CommentsSheet(
|
||||||
|
videoId!!,
|
||||||
|
comments,
|
||||||
|
commentsNextPage,
|
||||||
|
binding.root.height - binding.player.height
|
||||||
|
) { comments, nextPage ->
|
||||||
this.comments.addAll(comments)
|
this.comments.addAll(comments)
|
||||||
this.commentsNextPage = nextPage
|
this.commentsNextPage = nextPage
|
||||||
}.show(childFragmentManager)
|
}.show(childFragmentManager)
|
||||||
|
@ -20,6 +20,7 @@ class CommentsSheet(
|
|||||||
private val videoId: String,
|
private val videoId: String,
|
||||||
private val comments: List<Comment>,
|
private val comments: List<Comment>,
|
||||||
private var nextPage: String?,
|
private var nextPage: String?,
|
||||||
|
private val maxHeight: Int,
|
||||||
private val onMoreComments: (comments: List<Comment>, nextPage: String?) -> Unit
|
private val onMoreComments: (comments: List<Comment>, nextPage: String?) -> Unit
|
||||||
) : ExpandedBottomSheet() {
|
) : ExpandedBottomSheet() {
|
||||||
private lateinit var binding: CommentsSheetBinding
|
private lateinit var binding: CommentsSheetBinding
|
||||||
@ -29,6 +30,8 @@ class CommentsSheet(
|
|||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||||
binding = CommentsSheetBinding.inflate(layoutInflater)
|
binding = CommentsSheetBinding.inflate(layoutInflater)
|
||||||
|
// set a fixed maximum height
|
||||||
|
binding.root.maxHeight = maxHeight
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user