From 32cec6c9a74efd65b58ebf504c646bb61a222961 Mon Sep 17 00:00:00 2001 From: ge78fug Date: Tue, 7 Feb 2023 19:08:47 +0100 Subject: [PATCH] Changed the naming --- .../newpipe/fragments/detail/VideoDetailFragment.java | 4 ++-- .../newpipe/player/gesture/MainPlayerGestureListener.kt | 7 ++----- .../org/schabi/newpipe/player/helper/PlayerHelper.java | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index e63e549a2..7654e7689 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -2013,9 +2013,9 @@ public final class VideoDetailFragment restoreDefaultBrightness(); } else { // Do not restore if user has disabled brightness gesture - if (PlayerHelper.getRightSideGesture(activity) + if (PlayerHelper.getActionForRightGestureSide(activity) .equals(getString(R.string.brightness_control_key)) - || PlayerHelper.getLeftSideGesture(activity) + || PlayerHelper.getActionForLeftGestureSide(activity) .equals(getString(R.string.brightness_control_key))) { return; } 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 ce78fcfe2..0d28f2f58 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 @@ -193,18 +193,15 @@ class MainPlayerGestureListener( isMoving = true // -- Brightness and Volume control -- - val rightSide = PlayerHelper.getRightSideGesture(player.context) - val leftSide = PlayerHelper.getLeftSideGesture(player.context) - if (getDisplayHalfPortion(initialEvent) == DisplayPortion.RIGHT_HALF) { - when (rightSide) { + when (PlayerHelper.getActionForRightGestureSide(player.context)) { player.context.getString(R.string.volume_control_key) -> onScrollVolume(distanceY) player.context.getString(R.string.brightness_control_key) -> onScrollBrightness(distanceY) } } else { - when (leftSide) { + when (PlayerHelper.getActionForLeftGestureSide(player.context)) { player.context.getString(R.string.volume_control_key) -> onScrollVolume(distanceY) player.context.getString(R.string.brightness_control_key) -> diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java index 74bcf047c..a110a80d6 100644 --- a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java +++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java @@ -228,13 +228,13 @@ public final class PlayerHelper { .getBoolean(context.getString(R.string.resume_on_audio_focus_gain_key), false); } - public static String getRightSideGesture(@NonNull final Context context) { + public static String getActionForRightGestureSide(@NonNull final Context context) { return getPreferences(context) .getString(context.getString(R.string.right_gesture_control_key), context.getString(R.string.default_right_gesture_control_value)); } - public static String getLeftSideGesture(@NonNull final Context context) { + public static String getActionForLeftGestureSide(@NonNull final Context context) { return getPreferences(context) .getString(context.getString(R.string.left_gesture_control_key), context.getString(R.string.default_left_gesture_control_value));