[Android] Avoid hiding mini audio player

Nicolas Pomepuy git at videolan.org
Wed Jul 24 15:18:11 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Fri Jul 19 13:38:11 2019 +0200| [b9f8f8c77e7e77704df2aff3c86b519f53a57bf4] | committer: Geoffrey Métais

Avoid hiding mini audio player

> https://code.videolan.org/videolan/vlc-android/commit/b9f8f8c77e7e77704df2aff3c86b519f53a57bf4
---

 .../src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.kt | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.kt b/vlc-android/src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.kt
index f9b97268a..f1f1aaf89 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/BottomSheetBehavior.kt
@@ -7,7 +7,6 @@ import android.view.View
 import androidx.coordinatorlayout.widget.CoordinatorLayout
 import kotlinx.coroutines.ExperimentalCoroutinesApi
 import kotlinx.coroutines.ObsoleteCoroutinesApi
-import org.videolan.vlc.gui.AudioPlayerContainerActivity
 
 
 @ObsoleteCoroutinesApi
@@ -19,7 +18,7 @@ class BottomSheetBehavior<V : View> : com.google.android.material.bottomsheet.Bo
         isHideable = true
     }
 
-    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {}
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
 
     fun lock(lock: Boolean) {
         this.lock = lock
@@ -36,16 +35,6 @@ class BottomSheetBehavior<V : View> : com.google.android.material.bottomsheet.Bo
 
     }
 
-    override fun onNestedScroll(coordinatorLayout: CoordinatorLayout, child: V, target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, type: Int) {
-        if (lock || state == STATE_EXPANDED) return
-        if (dyConsumed > 0 && child.visibility == View.VISIBLE) {
-            val activity = child.context as AudioPlayerContainerActivity
-            activity.hideAudioPlayer()
-        } else if (dyConsumed < 0 && state == STATE_HIDDEN) {
-            val activity = child.context as AudioPlayerContainerActivity
-            activity.showAudioPlayer()
-        }
-    }
 
     override fun onStopNestedScroll(coordinatorLayout: CoordinatorLayout, child: V, target: View, type: Int) {
         if (lock) return



More information about the Android mailing list