[Android] Video player: avoid intercepting back gesture
Nicolas Pomepuy
git at videolan.org
Fri Feb 18 06:14:01 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Feb 17 09:06:41 2022 +0100| [244da3c61b38ec186ce663dd999681cb2107f71c] | committer: Nicolas Pomepuy
Video player: avoid intercepting back gesture
Fixes #2381
> https://code.videolan.org/videolan/vlc-android/commit/244da3c61b38ec186ce663dd999681cb2107f71c
---
.../src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 1893fe624..a2f01547e 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -61,6 +61,8 @@ import androidx.constraintlayout.widget.Guideline
import androidx.core.content.edit
import androidx.core.content.getSystemService
import androidx.core.net.toUri
+import androidx.core.view.ViewCompat
+import androidx.core.view.WindowInsetsControllerCompat
import androidx.databinding.BindingAdapter
import androidx.fragment.app.DialogFragment
import androidx.lifecycle.LiveData
@@ -484,6 +486,11 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
bookmarkModel = BookmarkModel.get(this)
overlayDelegate.playToPause = AnimatedVectorDrawableCompat.create(this, R.drawable.anim_play_pause_video)!!
overlayDelegate.pauseToPlay = AnimatedVectorDrawableCompat.create(this, R.drawable.anim_pause_play_video)!!
+
+ ViewCompat.getWindowInsetsController(window.decorView)?.let { windowInsetsController ->
+ windowInsetsController.systemBarsBehavior =
+ WindowInsetsControllerCompat.BEHAVIOR_SHOW_BARS_BY_SWIPE
+ }
}
/**
More information about the Android
mailing list