mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
commit
abff6e200f
@ -39,12 +39,16 @@ class VideoOptionsDialog(
|
|||||||
/**
|
/**
|
||||||
* Check whether the player is running by observing the notification
|
* Check whether the player is running by observing the notification
|
||||||
*/
|
*/
|
||||||
val notificationManager =
|
try {
|
||||||
context?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
val notificationManager =
|
||||||
notificationManager.activeNotifications.forEach {
|
context?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||||
if (it.id == PLAYER_NOTIFICATION_ID) {
|
notificationManager.activeNotifications.forEach {
|
||||||
optionsList += context?.getString(R.string.add_to_queue)
|
if (it.id == PLAYER_NOTIFICATION_ID) {
|
||||||
|
optionsList += context?.getString(R.string.add_to_queue)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
|
|
||||||
return MaterialAlertDialogBuilder(requireContext())
|
return MaterialAlertDialogBuilder(requireContext())
|
||||||
|
@ -25,7 +25,7 @@ fun View?.setWatchProgressLength(videoId: String, duration: Long) {
|
|||||||
.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
|
.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
|
||||||
override fun onGlobalLayout() {
|
override fun onGlobalLayout() {
|
||||||
this@setWatchProgressLength.getViewTreeObserver().removeOnGlobalLayoutListener(this)
|
this@setWatchProgressLength.getViewTreeObserver().removeOnGlobalLayoutListener(this)
|
||||||
if (progress == null) {
|
if (progress == null || duration == 0L) {
|
||||||
view.visibility = View.GONE
|
view.visibility = View.GONE
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user