Commit 5eea8d85 authored by Geoffrey Métais's avatar Geoffrey Métais

Option to disable seek on double tap

parent 2abb3c9f
......@@ -299,6 +299,8 @@
<string name="enable_volume_gesture_summary">Control volume by gesture during video playback</string>
<string name="enable_seek_buttons">Enable seek buttons</string>
<string name="enable_seek_buttons_summary">Show rewind and forward buttons on the video interface</string>
<string name="enable_double_tap_seek_title">Double tap to seek</string>
<string name="enable_double_tap_seek_summary">Double tap on screen edges to seek by 10 seconds</string>
<string name="subtitles_prefs_category">Subtitles</string>
<string name="subtitles_size_title">Subtitles Size</string>
......
......@@ -50,6 +50,11 @@
android:key="dialog_confirm_resume"
android:summary="@string/confirm_resume_summary"
android:title="@string/confirm_resume_title" />
<CheckBoxPreference
android:defaultValue="true"
android:key="enable_double_tap_seek"
android:summary="@string/enable_double_tap_seek_summary"
android:title="@string/enable_double_tap_seek_title" />
<CheckBoxPreference
android:defaultValue="false"
android:key="enable_seek_buttons"
......
......@@ -50,6 +50,7 @@ public class PreferencesVideo extends BasePreferenceFragment {
findPreference("force_list_portrait").setVisible(false);
findPreference("save_brightness").setVisible(false);
findPreference("video_min_group_length").setVisible(false);
findPreference("enable_double_tap_seek").setVisible(false);
findPreference("enable_volume_gesture").setVisible(AndroidDevices.hasTsp());
findPreference("enable_brightness_gesture").setVisible(AndroidDevices.hasTsp());
}
......
......@@ -203,6 +203,10 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
private int mCurrentSize;
private SharedPreferences mSettings;
private static final int TOUCH_FLAG_AUDIO_VOLUME = 1;
private static final int TOUCH_FLAG_BRIGHTNESS = 1 << 1;
private static final int TOUCH_FLAG_SEEK = 1 << 2;
private int mTouchControls = 0;
/** Overlay */
......@@ -387,8 +391,9 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
mSettings = PreferenceManager.getDefaultSharedPreferences(this);
if (!VLCApplication.showTvUi()) {
mTouchControls = (mSettings.getBoolean("enable_volume_gesture", true) ? 1 : 0)
+ (mSettings.getBoolean("enable_brightness_gesture", true) ? 2 : 0);
mTouchControls = (mSettings.getBoolean("enable_volume_gesture", true) ? TOUCH_FLAG_AUDIO_VOLUME : 0)
+ (mSettings.getBoolean("enable_brightness_gesture", true) ? TOUCH_FLAG_BRIGHTNESS : 0)
+ (mSettings.getBoolean("enable_double_tap_seek", true) ? TOUCH_FLAG_SEEK : 0);
}
/* Services and miscellaneous */
......@@ -2140,12 +2145,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
mTouchY = event.getRawY();
mTouchX = event.getRawX();
// Volume (Up or Down - Right side)
if (mTouchControls == 1 || (mTouchControls == 3 && (int)mTouchX > (4 * mScreen.widthPixels / 7f))){
if ((mTouchControls & TOUCH_FLAG_AUDIO_VOLUME) != 0 && (int)mTouchX > (4 * mScreen.widthPixels / 7f)){
doVolumeTouch(y_changed);
hideOverlay(true);
}
// Brightness (Up or Down - Left side)
if (mTouchControls == 2 || (mTouchControls == 3 && (int)mTouchX < (3 * mScreen.widthPixels / 7f))){
if ((mTouchControls & TOUCH_FLAG_BRIGHTNESS) != 0 && (int)mTouchX < (3 * mScreen.widthPixels / 7f)){
doBrightnessTouch(y_changed);
hideOverlay(true);
}
......@@ -3607,6 +3612,10 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
if (mService == null)
return false;
if (!mIsLocked) {
if ((mTouchControls & TOUCH_FLAG_SEEK) == 0) {
doPlayPause();
return true;
}
float x = e.getX();
if (x < range/4f)
seekDelta(-10000);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment