From 1c1520efde245ce956eb36f5566f93858b40d4c4 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Wed, 14 Jun 2023 09:31:06 +0200 Subject: [PATCH] Prevent audio miniplayer from being minimized with gestures --- .../libretube/ui/views/SingleViewTouchableMotionLayout.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/ui/views/SingleViewTouchableMotionLayout.kt b/app/src/main/java/com/github/libretube/ui/views/SingleViewTouchableMotionLayout.kt index 31cfff8e9..98e8e526d 100644 --- a/app/src/main/java/com/github/libretube/ui/views/SingleViewTouchableMotionLayout.kt +++ b/app/src/main/java/com/github/libretube/ui/views/SingleViewTouchableMotionLayout.kt @@ -81,7 +81,9 @@ class SingleViewTouchableMotionLayout(context: Context, attributeSet: AttributeS override fun onTouchEvent(event: MotionEvent): Boolean { gestureDetector.onTouchEvent(event) - // gestureDetector.onTouchEvent(event) + // don't react when trying to minimize audio player with gestures + if (viewToDetectTouch.id == R.id.audio_player_container && progress != 1f) return true + when (event.actionMasked) { MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { touchStarted = false