[Android] Enable the control settings for the TV video player
Nicolas Pomepuy
git at videolan.org
Fri Sep 23 11:22:59 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Sep 23 07:30:02 2022 +0200| [80b0fb81da75edf022d97a36f711d792710e79e3] | committer: Nicolas Pomepuy
Enable the control settings for the TV video player
> https://code.videolan.org/videolan/vlc-android/commit/80b0fb81da75edf022d97a36f711d792710e79e3
---
.../res/xml/preferences_video_controls.xml | 30 +++++++++++++++-------
.../vlc/gui/helpers/PlayerOptionsDelegate.kt | 12 +++++----
.../gui/preferences/PreferencesVideoControls.kt | 3 +++
3 files changed, 31 insertions(+), 14 deletions(-)
diff --git a/application/vlc-android/res/xml/preferences_video_controls.xml b/application/vlc-android/res/xml/preferences_video_controls.xml
index 7940a87b6..92f29dac3 100644
--- a/application/vlc-android/res/xml/preferences_video_controls.xml
+++ b/application/vlc-android/res/xml/preferences_video_controls.xml
@@ -10,6 +10,7 @@
android:key="audio_boost"
android:summary="@string/audio_boost_summary"
android:title="@string/audio_boost_title"
+ app:iconSpaceReserved="false"
app:singleLineTitle="false" />
<PreferenceCategory android:title="@string/gestures">
@@ -18,12 +19,14 @@
android:key="enable_volume_gesture"
android:summary="@string/enable_volume_gesture_summary"
android:title="@string/enable_volume_gesture_title"
+ app:iconSpaceReserved="false"
app:singleLineTitle="false" />
<CheckBoxPreference
android:defaultValue="true"
android:key="enable_brightness_gesture"
android:summary="@string/enable_brightness_gesture_summary"
android:title="@string/enable_brightness_gesture_title"
+ app:iconSpaceReserved="false"
app:singleLineTitle="false" />
<CheckBoxPreference
android:defaultValue="true"
@@ -36,33 +39,37 @@
android:key="enable_double_tap_seek"
android:summary="@string/enable_double_tap_seek_summary"
android:title="@string/enable_double_tap_seek_title"
+ app:iconSpaceReserved="false"
app:singleLineTitle="false" />
<CheckBoxPreference
android:defaultValue="true"
android:key="enable_double_tap_play"
android:summary="@string/enable_double_tap_play_summary"
android:title="@string/enable_double_tap_play_title"
+ app:iconSpaceReserved="false"
app:singleLineTitle="false" />
<CheckBoxPreference
android:defaultValue="true"
android:key="enable_swipe_seek"
android:summary="@string/enable_swipe_seek_summary"
android:title="@string/enable_swipe_seek_title"
- app:singleLineTitle="false"
- />
+ app:iconSpaceReserved="false"
+ app:singleLineTitle="false" />
<org.videolan.vlc.gui.view.NumberPickerPreference
android:defaultValue="10"
android:dependency="enable_double_tap_seek"
+ app:iconSpaceReserved="false"
app:key="video_double_tap_jump_delay"
app:title="@string/video_double_tap_jump_delay" />
<ListPreference
android:defaultValue="0"
- android:key="screenshot_mode"
- android:summary="%s"
android:entries="@array/video_screenshot"
android:entryValues="@array/video_screenshot_values"
+ android:key="screenshot_mode"
+ android:summary="%s"
android:title="@string/enable_video_screenshot"
- app:singleLineTitle="false" />
+ app:iconSpaceReserved="false"
+ app:singleLineTitle="false" />
</PreferenceCategory>
@@ -72,17 +79,20 @@
android:key="enable_seek_buttons"
android:summary="@string/enable_seek_buttons_summary"
android:title="@string/enable_seek_buttons"
+ app:iconSpaceReserved="false"
app:singleLineTitle="false" />
<org.videolan.vlc.gui.view.NumberPickerPreference
android:defaultValue="10"
android:dependency="enable_seek_buttons"
+ app:iconSpaceReserved="false"
app:key="video_jump_delay"
app:title="@string/jump_delay" />
<org.videolan.vlc.gui.view.NumberPickerPreference
android:defaultValue="20"
android:dependency="enable_seek_buttons"
+ app:iconSpaceReserved="false"
app:key="video_long_jump_delay"
app:title="@string/long_jump_delay" />
@@ -91,19 +101,21 @@
android:key="popup_keepscreen"
android:summary="@string/popup_keepscreen_summary"
android:title="@string/popup_keepscreen_title"
+ app:iconSpaceReserved="false"
app:singleLineTitle="false" />
<SeekBarPreference
android:defaultValue="4"
android:key="video_hud_timeout_in_s"
- app:updatesContinuously="true"
- android:summary="%s"
android:max="16"
+ android:summary="%s"
+ android:title="@string/video_hud_timeout"
+ app:iconSpaceReserved="false"
app:min="1"
app:seekBarIncrement="1"
- android:title="@string/video_hud_timeout"
- app:singleLineTitle="false" />
+ app:singleLineTitle="false"
+ app:updatesContinuously="true" />
</PreferenceCategory>
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
index fbd75dd36..05ebc8413 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
@@ -112,14 +112,16 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
options.add(PlayerOption(ID_SAVE_PLAYLIST, R.drawable.ic_addtoplaylist, res.getString(R.string.playlist_save)))
if (service.playlistManager.player.canDoPassthrough() && settings.getString("aout", "0") == "0")
options.add(PlayerOption(ID_PASSTHROUGH, R.drawable.ic_passthrough, res.getString(R.string.audio_digital_title)))
+ if (video)
+ options.add(PlayerOption(ID_VIDEO_CONTROLS_SETTING, R.drawable.ic_video_controls, res.getString(R.string.controls_setting)))
+
if (!Settings.showTvUi) {
if (video) {
- options.add(PlayerOption(ID_VIDEO_CONTROLS_SETTING, R.drawable.ic_video_controls, res.getString(R.string.controls_setting)))
- options.add(PlayerOption(ID_SHOW_VIDEO_TIPS, R.drawable.ic_videotips, res.getString(R.string.tips_title)))
+ options.add(PlayerOption(ID_SHOW_VIDEO_TIPS, R.drawable.ic_videotips, res.getString(R.string.tips_title)))
} else {
- options.add(PlayerOption(ID_AUDIO_CONTROLS_SETTING, R.drawable.ic_audio_controls, res.getString(R.string.controls_setting)))
- options.add(PlayerOption(ID_SHOW_AUDIO_TIPS, R.drawable.ic_audiotips, res.getString(R.string.audio_player_tips)))
- options.add(PlayerOption(ID_SHOW_PLAYLIST_TIPS, R.drawable.ic_playlisttips, res.getString(R.string.playlist_tips)))
+ options.add(PlayerOption(ID_AUDIO_CONTROLS_SETTING, R.drawable.ic_audio_controls, res.getString(R.string.controls_setting)))
+ options.add(PlayerOption(ID_SHOW_AUDIO_TIPS, R.drawable.ic_audiotips, res.getString(R.string.audio_player_tips)))
+ options.add(PlayerOption(ID_SHOW_PLAYLIST_TIPS, R.drawable.ic_playlisttips, res.getString(R.string.playlist_tips)))
}
}
(recyclerview.adapter as OptionsAdapter).update(options)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesVideoControls.kt b/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesVideoControls.kt
index e7eeeacf7..129e97a9b 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesVideoControls.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesVideoControls.kt
@@ -43,6 +43,9 @@ class PreferencesVideoControls : BasePreferenceFragment(), SharedPreferences.OnS
findPreference<Preference>(AUDIO_BOOST)?.isVisible = !AndroidDevices.isAndroidTv
findPreference<Preference>(ENABLE_DOUBLE_TAP_SEEK)?.isVisible = !AndroidDevices.isAndroidTv
findPreference<Preference>(ENABLE_DOUBLE_TAP_PLAY)?.isVisible = !AndroidDevices.isAndroidTv
+ findPreference<Preference>(ENABLE_SCALE_GESTURE)?.isVisible = !AndroidDevices.isAndroidTv
+ findPreference<Preference>(ENABLE_SWIPE_SEEK)?.isVisible = !AndroidDevices.isAndroidTv
+ findPreference<Preference>(SCREENSHOT_MODE)?.isVisible = !AndroidDevices.isAndroidTv
findPreference<Preference>(ENABLE_VOLUME_GESTURE)?.isVisible = AndroidDevices.hasTsp
findPreference<Preference>(ENABLE_BRIGHTNESS_GESTURE)?.isVisible = AndroidDevices.hasTsp
findPreference<Preference>(POPUP_KEEPSCREEN)?.isVisible = !AndroidDevices.isAndroidTv && !AndroidUtil.isOOrLater
More information about the Android
mailing list