mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 05:40:31 +05:30
ktlint
This commit is contained in:
parent
5c7bfc78a9
commit
ce801b59c7
@ -91,7 +91,7 @@ class BackgroundMode {
|
||||
/**
|
||||
* Gets the video data and prepares the [player].
|
||||
*/
|
||||
fun playOnBackgroundMode(c: Context, videoId: String, seekToPosition : Long) {
|
||||
fun playOnBackgroundMode(c: Context, videoId: String, seekToPosition: Long) {
|
||||
runBlocking {
|
||||
val job = launch {
|
||||
response = RetrofitInstance.api.getStreams(videoId)
|
||||
@ -111,7 +111,6 @@ class BackgroundMode {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a singleton of this class, to not create a new [player] every time.
|
||||
*/
|
||||
|
@ -40,7 +40,9 @@ class VideoOptionsDialog(private val videoId: String, context: Context) : Dialog
|
||||
when (which) {
|
||||
// This for example will be the "Background mode" option
|
||||
0 -> {
|
||||
BackgroundMode.getInstance().playOnBackgroundMode(requireContext(), videoId, 0)
|
||||
BackgroundMode
|
||||
.getInstance()
|
||||
.playOnBackgroundMode(requireContext(), videoId, 0)
|
||||
}
|
||||
else -> {
|
||||
dialog.dismiss()
|
||||
|
@ -86,7 +86,8 @@ class SubscriptionAdapter(
|
||||
}
|
||||
holder.v.setOnLongClickListener {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,8 @@ class TrendingAdapter(
|
||||
}
|
||||
holder.v.setOnLongClickListener {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user