1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-22 16:10:31 +00:00

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-01-20 22:48:10 +01:00 committed by Stypox
parent 3c74cb3439
commit 96e9242431

View File

@ -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)