This commit is contained in:
Bnyro 2022-05-27 19:22:45 +02:00
parent 5c7bfc78a9
commit ce801b59c7
4 changed files with 8 additions and 5 deletions

View File

@ -111,7 +111,6 @@ class BackgroundMode {
} }
} }
/** /**
* Creates a singleton of this class, to not create a new [player] every time. * Creates a singleton of this class, to not create a new [player] every time.
*/ */

View File

@ -40,7 +40,9 @@ class VideoOptionsDialog(private val videoId: String, context: Context) : Dialog
when (which) { when (which) {
// This for example will be the "Background mode" option // This for example will be the "Background mode" option
0 -> { 0 -> {
BackgroundMode.getInstance().playOnBackgroundMode(requireContext(), videoId, 0) BackgroundMode
.getInstance()
.playOnBackgroundMode(requireContext(), videoId, 0)
} }
else -> { else -> {
dialog.dismiss() dialog.dismiss()

View File

@ -86,7 +86,8 @@ class SubscriptionAdapter(
} }
holder.v.setOnLongClickListener { holder.v.setOnLongClickListener {
val videoId = trending.url!!.replace("/watch?v=", "") val videoId = trending.url!!.replace("/watch?v=", "")
VideoOptionsDialog(videoId, holder.v.context).show(childFragmentManager, VideoOptionsDialog.TAG) VideoOptionsDialog(videoId, holder.v.context)
.show(childFragmentManager, VideoOptionsDialog.TAG)
true true
} }
} }

View File

@ -82,7 +82,8 @@ class TrendingAdapter(
} }
holder.v.setOnLongClickListener { holder.v.setOnLongClickListener {
val videoId = trending.url!!.replace("/watch?v=", "") val videoId = trending.url!!.replace("/watch?v=", "")
VideoOptionsDialog(videoId, holder.v.context).show(childFragmentManager, VideoOptionsDialog.TAG) VideoOptionsDialog(videoId, holder.v.context)
.show(childFragmentManager, VideoOptionsDialog.TAG)
true true
} }
} }