From 217dd9b99073dcf9deb06439a3c435ed8fbdc3d5 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Wed, 27 Jul 2022 08:59:44 +0200 Subject: [PATCH] restore lock player functionality --- .../java/com/github/libretube/fragments/PlayerFragment.kt | 4 ++-- .../java/com/github/libretube/util/OnCustomEventListener.kt | 2 -- .../java/com/github/libretube/views/CustomExoPlayerView.kt | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index 758b598fc..ee43cd1b5 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -1520,10 +1520,10 @@ class PlayerFragment : Fragment() { // disable double tap to seek when the player is locked if (isLocked) { // enable fast forward and rewind by double tapping - binding.doubleTapOverlay.visibility = View.VISIBLE + enableDoubleTapToSeek() } else { // disable fast forward and rewind by double tapping - binding.doubleTapOverlay.visibility = View.GONE + binding.player.setOnDoubleTapListener(null) } } diff --git a/app/src/main/java/com/github/libretube/util/OnCustomEventListener.kt b/app/src/main/java/com/github/libretube/util/OnCustomEventListener.kt index 511247323..8884b00f1 100644 --- a/app/src/main/java/com/github/libretube/util/OnCustomEventListener.kt +++ b/app/src/main/java/com/github/libretube/util/OnCustomEventListener.kt @@ -1,7 +1,5 @@ package com.github.libretube.util -import android.view.MotionEvent - interface OnCustomEventListener { fun onEvent(x: Float) } diff --git a/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt b/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt index d0c33eb50..dbcbae23e 100644 --- a/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt +++ b/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt @@ -3,11 +3,8 @@ package com.github.libretube.views import android.annotation.SuppressLint import android.content.Context import android.util.AttributeSet -import android.util.Log -import android.view.GestureDetector import android.view.MotionEvent import android.view.View -import android.view.View.OnTouchListener import com.github.libretube.R import com.github.libretube.databinding.ExoStyledPlayerControlViewBinding import com.github.libretube.util.DoubleTapListener @@ -28,7 +25,7 @@ internal class CustomExoPlayerView( var xPos = 0F fun setOnDoubleTapListener( - eventListener: OnCustomEventListener + eventListener: OnCustomEventListener? ) { doubleTapListener = eventListener }