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