From 581bf1d43039687d1936647cbeeacfc9eb1eae41 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 6 Jan 2023 21:27:31 +0100 Subject: [PATCH] Don't dim player background when locked --- .../github/libretube/ui/views/CustomExoPlayerView.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt index 19eb502b8..04fd05430 100644 --- a/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt +++ b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt @@ -4,11 +4,13 @@ import android.annotation.SuppressLint import android.app.Activity import android.content.Context import android.content.res.Configuration +import android.graphics.Color import android.os.Handler import android.os.Looper import android.util.AttributeSet import android.view.MotionEvent import android.view.View +import androidx.core.content.ContextCompat import com.github.libretube.R import com.github.libretube.databinding.DoubleTapOverlayBinding import com.github.libretube.databinding.ExoStyledPlayerControlViewBinding @@ -319,6 +321,14 @@ internal class CustomExoPlayerView( binding.exoTitle.visibility = visibility binding.playPauseBTN.visibility = visibility + // hide the dimming background overlay if locked + binding.exoControlsBackground.setBackgroundColor( + if (isLocked) ContextCompat.getColor( + context, + com.google.android.exoplayer2.R.color.exo_black_opacity_60 + ) else Color.TRANSPARENT + ) + // disable tap and swipe gesture if the player is locked playerGestureController.isEnabled = isLocked }