Always use the chapters dialog as on title click action

This commit is contained in:
Bnyro 2023-01-23 18:40:04 +01:00
parent 93b073a357
commit 7b16580cb1

View File

@ -1159,17 +1159,14 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
"(${chapter.start?.let { DateUtils.formatElapsedTime(it) }}) ${chapter.title}" "(${chapter.start?.let { DateUtils.formatElapsedTime(it) }}) ${chapter.title}"
} }
playerBinding.chapterLL.setOnClickListener { playerBinding.chapterLL.setOnClickListener {
if (viewModel.isFullscreen.value!!) { MaterialAlertDialogBuilder(requireContext())
MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.chapters)
.setTitle(R.string.chapters) .setItems(titles.toTypedArray()) { _, index ->
.setItems(titles.toTypedArray()) { _, index -> exoPlayer.seekTo(chapters[index].start!! * 1000)
exoPlayer.seekTo(chapters[index].start!! * 1000) }
} .show()
.show()
} else {
toggleDescription()
}
} }
setCurrentChapterName() setCurrentChapterName()
} }