From 96e9242431c5c101c93b9629a9fbf7b0cf408825 Mon Sep 17 00:00:00 2001 From: Marius Wagner Date: Fri, 20 Jan 2023 22:48:10 +0100 Subject: [PATCH] Update app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt Co-authored-by: Stypox --- .../newpipe/player/gesture/MainPlayerGestureListener.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt b/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt index 75a27896d..d6dc37e95 100644 --- a/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt +++ b/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt @@ -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)