Update app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt

Co-authored-by: Stypox <stypox@pm.me>
This commit is contained in:
Marius Wagner
2023-04-04 09:57:06 +02:00
committed by Stypox
co-authored by Stypox
parent 3c74cb3439
commit 96e9242431
@@ -196,12 +196,9 @@ class MainPlayerGestureListener(
// -- Brightness and Volume control --
var isBrightnessGestureEnabled = PlayerHelper.isBrightnessGestureEnabled(player.context)
var isVolumeGestureEnabled = PlayerHelper.isVolumeGestureEnabled(player.context)
var displaySide = DisplayPortion.LEFT_HALF
val sidesSwitched = PreferenceManager.getDefaultSharedPreferences(player.context)
.getBoolean(R.string.switch_gesture_sides_key.toString(), false)
if (sidesSwitched) {
displaySide = DisplayPortion.RIGHT_HALF
}
val brightnessSide = if (PreferenceManager.getDefaultSharedPreferences(player.context)
.getBoolean(R.string.switch_gesture_sides_key.toString(), false)) DisplayPortion.RIGHT_HALF
else DisplayPortion.LEFT_HALF
if (isBrightnessGestureEnabled && isVolumeGestureEnabled) {
if (getDisplayHalfPortion(initialEvent) === displaySide) {
onScrollBrightness(distanceY)