Changed the naming

This commit is contained in:
ge78fug 2023-02-07 19:08:47 +01:00 committed by Stypox
parent 72ca52a29b
commit 32cec6c9a7
3 changed files with 6 additions and 9 deletions

View File

@ -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;
}

View File

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

View File

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