Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,12 @@ class MainPlayerGestureListener(

override fun getDisplayPortion(e: MotionEvent): DisplayPortion {
return when {
e.x < binding.root.width * 0.3 -> DisplayPortion.LEFT
e.x > binding.root.width * 0.7 -> DisplayPortion.RIGHT
e.x < binding.root.width *
(0.5 - PlayerHelper.getMiddleGestureWidth(player.context) / 2.0)
-> DisplayPortion.LEFT
e.x > binding.root.width *
(0.5 + PlayerHelper.getMiddleGestureWidth(player.context) / 2.0)
-> DisplayPortion.RIGHT
else -> DisplayPortion.MIDDLE
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ public static String getActionForLeftGestureSide(@NonNull final Context context)
context.getString(R.string.default_left_gesture_control_value));
}

public static double getMiddleGestureWidth(@NonNull final Context context) {
return Float.parseFloat(getPreferences(context).getString(
context.getString(R.string.middle_gesture_area_width_key),
context.getString(R.string.default_middle_gesture_area_width_value)));
}

public static boolean isStartMainPlayerFullscreenEnabled(@NonNull final Context context) {
return getPreferences(context)
.getBoolean(context.getString(R.string.start_main_player_fullscreen_key), false);
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/res/values/settings_keys.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,21 @@
<item>5</item>
<item>10</item>
</string-array>

<string name="middle_gesture_area_width_key">middle_gesture_area_width</string>
<string name="default_middle_gesture_area_width_value">.3333</string>
<string-array name="middle_gesture_area_width_description_list">
<item>15%</item>
<item>25%</item>
<item>33%</item>
<item>40%</item>
</string-array>
<string-array name="middle_gesture_area_width_values_list">
<item>.15</item>
<item>.25</item>
<item>.3333</item>
<item>.4</item>
</string-array>

<string name="prefer_original_audio_key">prefer_original_audio</string>
<string name="prefer_descriptive_audio_key">prefer_descriptive_audio</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@
<string name="middle_gesture_control_title">Middle gesture action</string>
<string name="right_gesture_control_summary">Choose gesture for right part of player screen</string>
<string name="right_gesture_control_title">Right gesture action</string>
<string name="middle_gesture_width_summary">Choose area width for middle part of player screen</string>
<string name="middle_gesture_width_title">Middle gesture area width</string>
<string name="brightness">Brightness</string>
<string name="volume">Volume</string>
<string name="none">None</string>
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/xml/video_audio_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@
android:title="@string/max_playback_speed_title"
app:singleLineTitle="false"
app:iconSpaceReserved="false" />

<ListPreference
android:defaultValue="@string/default_middle_gesture_area_width_value"
android:entries="@array/middle_gesture_area_width_description_list"
android:entryValues="@array/middle_gesture_area_width_values_list"
android:key="@string/middle_gesture_area_width_key"
android:summary="@string/middle_gesture_width_summary"
android:title="@string/middle_gesture_width_title"
app:singleLineTitle="false"
app:iconSpaceReserved="false" />

<SwitchPreferenceCompat
android:defaultValue="true"
Expand Down