mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20: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 {
|
||||
CommentsSheet(videoId!!, comments, commentsNextPage) { comments, nextPage ->
|
||||
CommentsSheet(
|
||||
videoId!!,
|
||||
comments,
|
||||
commentsNextPage,
|
||||
binding.root.height - binding.player.height
|
||||
) { comments, nextPage ->
|
||||
this.comments.addAll(comments)
|
||||
this.commentsNextPage = nextPage
|
||||
}.show(childFragmentManager)
|
||||
|
@ -20,6 +20,7 @@ class CommentsSheet(
|
||||
private val videoId: String,
|
||||
private val comments: List<Comment>,
|
||||
private var nextPage: String?,
|
||||
private val maxHeight: Int,
|
||||
private val onMoreComments: (comments: List<Comment>, nextPage: String?) -> Unit
|
||||
) : ExpandedBottomSheet() {
|
||||
private lateinit var binding: CommentsSheetBinding
|
||||
@ -29,6 +30,8 @@ class CommentsSheet(
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
binding = CommentsSheetBinding.inflate(layoutInflater)
|
||||
// set a fixed maximum height
|
||||
binding.root.maxHeight = maxHeight
|
||||
return binding.root
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user