1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-11-01 07:43:00 +00:00

Add option to disable the gesture controls of the player

This commit is contained in:
Mauricio Colli
2017-05-16 21:45:38 -03:00
parent f0761cc95e
commit c00e694d40
4 changed files with 14 additions and 0 deletions

View File

@@ -449,6 +449,8 @@ public class MainVideoPlayer extends Activity {
return true;
}
private final boolean isGestureControlsEnabled = playerImpl.getSharedPreferences().getBoolean(getString(R.string.player_gesture_controls_key), true);
private final float stepsBrightness = 15, stepBrightness = (1f / stepsBrightness), minBrightness = .01f;
private float currentBrightness = .5f;
@@ -466,6 +468,8 @@ public class MainVideoPlayer extends Activity {
// TODO: Improve video gesture controls
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
if (!isGestureControlsEnabled) return false;
//noinspection PointlessBooleanExpression
if (DEBUG && false) Log.d(TAG, "MainVideoPlayer.onScroll = " +
", e1.getRaw = [" + e1.getRawX() + ", " + e1.getRawY() + "]" +