mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
Merge pull request #751 from Bnyro/master
chapter name clickable in portrait
This commit is contained in:
commit
988538662c
@ -262,9 +262,7 @@ class PlayerFragment : Fragment() {
|
|||||||
|
|
||||||
// video description and chapters toggle
|
// video description and chapters toggle
|
||||||
binding.playerTitleLayout.setOnClickListener {
|
binding.playerTitleLayout.setOnClickListener {
|
||||||
binding.playerDescriptionArrow.animate().rotationBy(180F).setDuration(250).start()
|
toggleDescription()
|
||||||
binding.descLinLayout.visibility =
|
|
||||||
if (binding.descLinLayout.isVisible) View.GONE else View.VISIBLE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.commentsToggle.setOnClickListener {
|
binding.commentsToggle.setOnClickListener {
|
||||||
@ -338,7 +336,6 @@ class PlayerFragment : Fragment() {
|
|||||||
binding.linLayout.visibility = View.GONE
|
binding.linLayout.visibility = View.GONE
|
||||||
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen_exit)
|
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen_exit)
|
||||||
playerBinding.exoTitle.visibility = View.VISIBLE
|
playerBinding.exoTitle.visibility = View.VISIBLE
|
||||||
playerBinding.chapterLL.isClickable = true
|
|
||||||
|
|
||||||
val mainActivity = activity as MainActivity
|
val mainActivity = activity as MainActivity
|
||||||
val fullscreenOrientationPref = PreferenceHelper
|
val fullscreenOrientationPref = PreferenceHelper
|
||||||
@ -375,7 +372,6 @@ class PlayerFragment : Fragment() {
|
|||||||
binding.linLayout.visibility = View.VISIBLE
|
binding.linLayout.visibility = View.VISIBLE
|
||||||
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen)
|
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen)
|
||||||
playerBinding.exoTitle.visibility = View.INVISIBLE
|
playerBinding.exoTitle.visibility = View.INVISIBLE
|
||||||
playerBinding.chapterLL.isClickable = false
|
|
||||||
|
|
||||||
scaleControls(1F)
|
scaleControls(1F)
|
||||||
|
|
||||||
@ -390,6 +386,12 @@ class PlayerFragment : Fragment() {
|
|||||||
playerBinding.exoPlayPause.scaleY = scaleFactor
|
playerBinding.exoPlayPause.scaleY = scaleFactor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun toggleDescription() {
|
||||||
|
binding.playerDescriptionArrow.animate().rotationBy(180F).setDuration(250).start()
|
||||||
|
binding.descLinLayout.visibility =
|
||||||
|
if (binding.descLinLayout.isVisible) View.GONE else View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
private fun toggleComments() {
|
private fun toggleComments() {
|
||||||
binding.commentsRecView.visibility =
|
binding.commentsRecView.visibility =
|
||||||
if (binding.commentsRecView.isVisible) View.GONE else View.VISIBLE
|
if (binding.commentsRecView.isVisible) View.GONE else View.VISIBLE
|
||||||
@ -716,8 +718,6 @@ class PlayerFragment : Fragment() {
|
|||||||
if (response.chapters != null) {
|
if (response.chapters != null) {
|
||||||
chapters = response.chapters
|
chapters = response.chapters
|
||||||
initializeChapters()
|
initializeChapters()
|
||||||
// disabling chapterName click in portrait mode
|
|
||||||
playerBinding.chapterLL.isClickable = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set default playback speed
|
// set default playback speed
|
||||||
@ -1012,6 +1012,7 @@ class PlayerFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
playerBinding.chapterLL.visibility = View.VISIBLE
|
playerBinding.chapterLL.visibility = View.VISIBLE
|
||||||
playerBinding.chapterLL.setOnClickListener {
|
playerBinding.chapterLL.setOnClickListener {
|
||||||
|
if (isFullScreen) {
|
||||||
MaterialAlertDialogBuilder(requireContext())
|
MaterialAlertDialogBuilder(requireContext())
|
||||||
.setTitle(R.string.chapters)
|
.setTitle(R.string.chapters)
|
||||||
.setItems(titles.toTypedArray()) { _, index ->
|
.setItems(titles.toTypedArray()) { _, index ->
|
||||||
@ -1019,6 +1020,9 @@ class PlayerFragment : Fragment() {
|
|||||||
exoPlayer.seekTo(position)
|
exoPlayer.seekTo(position)
|
||||||
}
|
}
|
||||||
.show()
|
.show()
|
||||||
|
} else {
|
||||||
|
toggleDescription()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setCurrentChapterName()
|
setCurrentChapterName()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user