Changed the naming

pull/9708/head
ge78fug 2023-02-07 19:08:47 +01:00 zatwierdzone przez Stypox
rodzic 72ca52a29b
commit 32cec6c9a7
3 zmienionych plików z 6 dodań i 9 usunięć

Wyświetl plik

@ -2013,9 +2013,9 @@ public final class VideoDetailFragment
restoreDefaultBrightness(); restoreDefaultBrightness();
} else { } else {
// Do not restore if user has disabled brightness gesture // Do not restore if user has disabled brightness gesture
if (PlayerHelper.getRightSideGesture(activity) if (PlayerHelper.getActionForRightGestureSide(activity)
.equals(getString(R.string.brightness_control_key)) .equals(getString(R.string.brightness_control_key))
|| PlayerHelper.getLeftSideGesture(activity) || PlayerHelper.getActionForLeftGestureSide(activity)
.equals(getString(R.string.brightness_control_key))) { .equals(getString(R.string.brightness_control_key))) {
return; return;
} }

Wyświetl plik

@ -193,18 +193,15 @@ class MainPlayerGestureListener(
isMoving = true isMoving = true
// -- Brightness and Volume control -- // -- Brightness and Volume control --
val rightSide = PlayerHelper.getRightSideGesture(player.context)
val leftSide = PlayerHelper.getLeftSideGesture(player.context)
if (getDisplayHalfPortion(initialEvent) == DisplayPortion.RIGHT_HALF) { if (getDisplayHalfPortion(initialEvent) == DisplayPortion.RIGHT_HALF) {
when (rightSide) { when (PlayerHelper.getActionForRightGestureSide(player.context)) {
player.context.getString(R.string.volume_control_key) -> player.context.getString(R.string.volume_control_key) ->
onScrollVolume(distanceY) onScrollVolume(distanceY)
player.context.getString(R.string.brightness_control_key) -> player.context.getString(R.string.brightness_control_key) ->
onScrollBrightness(distanceY) onScrollBrightness(distanceY)
} }
} else { } else {
when (leftSide) { when (PlayerHelper.getActionForLeftGestureSide(player.context)) {
player.context.getString(R.string.volume_control_key) -> player.context.getString(R.string.volume_control_key) ->
onScrollVolume(distanceY) onScrollVolume(distanceY)
player.context.getString(R.string.brightness_control_key) -> player.context.getString(R.string.brightness_control_key) ->

Wyświetl plik

@ -228,13 +228,13 @@ public final class PlayerHelper {
.getBoolean(context.getString(R.string.resume_on_audio_focus_gain_key), false); .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) return getPreferences(context)
.getString(context.getString(R.string.right_gesture_control_key), .getString(context.getString(R.string.right_gesture_control_key),
context.getString(R.string.default_right_gesture_control_value)); 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) return getPreferences(context)
.getString(context.getString(R.string.left_gesture_control_key), .getString(context.getString(R.string.left_gesture_control_key),
context.getString(R.string.default_left_gesture_control_value)); context.getString(R.string.default_left_gesture_control_value));