mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Merge pull request #1191 from Bnyro/master
move audio and video settings to its own fragment
This commit is contained in:
commit
ba7cb67c27
@ -0,0 +1,17 @@
|
|||||||
|
package com.github.libretube.preferences
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.github.libretube.R
|
||||||
|
import com.github.libretube.activities.SettingsActivity
|
||||||
|
import com.github.libretube.views.MaterialPreferenceFragment
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
class AudioVideoSettings : MaterialPreferenceFragment() {
|
||||||
|
|
||||||
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
setPreferencesFromResource(R.xml.audio_video_settings, rootKey)
|
||||||
|
|
||||||
|
val settingsActivity = activity as? SettingsActivity
|
||||||
|
settingsActivity?.changeTopBarText(getString(R.string.audio_video))
|
||||||
|
}
|
||||||
|
}
|
@ -55,6 +55,13 @@ class MainSettings : MaterialPreferenceFragment() {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val audioVideo = findPreference<Preference>("audio_video")
|
||||||
|
audioVideo?.setOnPreferenceClickListener {
|
||||||
|
val newFragment = AudioVideoSettings()
|
||||||
|
navigateToSettingsFragment(newFragment)
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
val history = findPreference<Preference>("history")
|
val history = findPreference<Preference>("history")
|
||||||
history?.setOnPreferenceClickListener {
|
history?.setOnPreferenceClickListener {
|
||||||
val newFragment = HistorySettings()
|
val newFragment = HistorySettings()
|
||||||
|
@ -15,7 +15,7 @@ class PlayerSettings : MaterialPreferenceFragment() {
|
|||||||
setPreferencesFromResource(R.xml.player_settings, rootKey)
|
setPreferencesFromResource(R.xml.player_settings, rootKey)
|
||||||
|
|
||||||
val settingsActivity = activity as? SettingsActivity
|
val settingsActivity = activity as? SettingsActivity
|
||||||
settingsActivity?.changeTopBarText(getString(R.string.audio_video))
|
settingsActivity?.changeTopBarText(getString(R.string.player))
|
||||||
|
|
||||||
val playerOrientation =
|
val playerOrientation =
|
||||||
findPreference<ListPreference>(PreferenceKeys.FULLSCREEN_ORIENTATION)
|
findPreference<ListPreference>(PreferenceKeys.FULLSCREEN_ORIENTATION)
|
||||||
|
@ -189,7 +189,7 @@
|
|||||||
<string name="instance_frontend_url">URL to instance frontend</string>
|
<string name="instance_frontend_url">URL to instance frontend</string>
|
||||||
<string name="quality">Quality</string>
|
<string name="quality">Quality</string>
|
||||||
<string name="behavior">Behavior</string>
|
<string name="behavior">Behavior</string>
|
||||||
<string name="player_summary">Quality, and player behavior</string>
|
<string name="player_summary">Defaults and behavior</string>
|
||||||
<string name="seek_increment">Seek increment</string>
|
<string name="seek_increment">Seek increment</string>
|
||||||
<string name="pauseOnScreenOff">Auto-pause</string>
|
<string name="pauseOnScreenOff">Auto-pause</string>
|
||||||
<string name="pauseOnScreenOff_summary">Pause playback when the screen is turned off.</string>
|
<string name="pauseOnScreenOff_summary">Pause playback when the screen is turned off.</string>
|
||||||
@ -313,4 +313,5 @@
|
|||||||
<string name="break_reminder_time">Minutes before being reminded</string>
|
<string name="break_reminder_time">Minutes before being reminded</string>
|
||||||
<string name="legacy_subscriptions">Legacy subscriptions view</string>
|
<string name="legacy_subscriptions">Legacy subscriptions view</string>
|
||||||
<string name="device_info">Device Info</string>
|
<string name="device_info">Device Info</string>
|
||||||
|
<string name="audio_video_summary">Quality and format</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
55
app/src/main/res/xml/audio_video_settings.xml
Normal file
55
app/src/main/res/xml/audio_video_settings.xml
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<PreferenceCategory app:title="@string/quality">
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:icon="@drawable/ic_hd"
|
||||||
|
app:defaultValue=""
|
||||||
|
app:entries="@array/defres"
|
||||||
|
app:entryValues="@array/defresValue"
|
||||||
|
app:key="default_res"
|
||||||
|
app:title="@string/defres"
|
||||||
|
app:useSimpleSummaryProvider="true" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:icon="@drawable/ic_headphones"
|
||||||
|
app:defaultValue="best"
|
||||||
|
app:entries="@array/audioQuality"
|
||||||
|
app:entryValues="@array/audioQualityValues"
|
||||||
|
app:key="player_audio_quality"
|
||||||
|
app:title="@string/playerAudioQuality"
|
||||||
|
app:useSimpleSummaryProvider="true" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:icon="@drawable/ic_videocam"
|
||||||
|
app:defaultValue="webm"
|
||||||
|
app:entries="@array/playerVideoFormat"
|
||||||
|
app:entryValues="@array/playerVideoFormatValues"
|
||||||
|
app:key="player_video_format"
|
||||||
|
app:title="@string/playerVideoFormat"
|
||||||
|
app:useSimpleSummaryProvider="true" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:icon="@drawable/ic_music"
|
||||||
|
app:defaultValue="all"
|
||||||
|
app:entries="@array/playerAudioFormat"
|
||||||
|
app:entryValues="@array/playerAudioFormatValues"
|
||||||
|
app:key="player_audio_format"
|
||||||
|
app:title="@string/playerAudioFormat"
|
||||||
|
app:useSimpleSummaryProvider="true" />
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory app:title="@string/background_mode">
|
||||||
|
|
||||||
|
<com.github.libretube.extensions.SliderPreference
|
||||||
|
android:icon="@drawable/ic_speed"
|
||||||
|
app:defaultValue="1.0"
|
||||||
|
app:key="background_playback_speed"
|
||||||
|
app:title="@string/playback_speed" />
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
@ -2,46 +2,6 @@
|
|||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<PreferenceCategory app:title="@string/quality">
|
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
android:icon="@drawable/ic_hd"
|
|
||||||
app:defaultValue=""
|
|
||||||
app:entries="@array/defres"
|
|
||||||
app:entryValues="@array/defresValue"
|
|
||||||
app:key="default_res"
|
|
||||||
app:title="@string/defres"
|
|
||||||
app:useSimpleSummaryProvider="true" />
|
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
android:icon="@drawable/ic_headphones"
|
|
||||||
app:defaultValue="best"
|
|
||||||
app:entries="@array/audioQuality"
|
|
||||||
app:entryValues="@array/audioQualityValues"
|
|
||||||
app:key="player_audio_quality"
|
|
||||||
app:title="@string/playerAudioQuality"
|
|
||||||
app:useSimpleSummaryProvider="true" />
|
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
android:icon="@drawable/ic_videocam"
|
|
||||||
app:defaultValue="webm"
|
|
||||||
app:entries="@array/playerVideoFormat"
|
|
||||||
app:entryValues="@array/playerVideoFormatValues"
|
|
||||||
app:key="player_video_format"
|
|
||||||
app:title="@string/playerVideoFormat"
|
|
||||||
app:useSimpleSummaryProvider="true" />
|
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
android:icon="@drawable/ic_music"
|
|
||||||
app:defaultValue="all"
|
|
||||||
app:entries="@array/playerAudioFormat"
|
|
||||||
app:entryValues="@array/playerAudioFormatValues"
|
|
||||||
app:key="player_audio_format"
|
|
||||||
app:title="@string/playerAudioFormat"
|
|
||||||
app:useSimpleSummaryProvider="true" />
|
|
||||||
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory app:title="@string/player">
|
<PreferenceCategory app:title="@string/player">
|
||||||
|
|
||||||
<com.github.libretube.extensions.SliderPreference
|
<com.github.libretube.extensions.SliderPreference
|
||||||
@ -132,14 +92,4 @@
|
|||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory app:title="@string/background_mode">
|
|
||||||
|
|
||||||
<com.github.libretube.extensions.SliderPreference
|
|
||||||
android:icon="@drawable/ic_speed"
|
|
||||||
app:defaultValue="1.0"
|
|
||||||
app:key="background_playback_speed"
|
|
||||||
app:title="@string/playback_speed" />
|
|
||||||
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
@ -27,9 +27,15 @@
|
|||||||
app:title="@string/sponsorblock" />
|
app:title="@string/sponsorblock" />
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:icon="@drawable/ic_movie"
|
android:icon="@drawable/ic_play_filled"
|
||||||
app:key="player"
|
app:key="player"
|
||||||
app:summary="@string/player_summary"
|
app:summary="@string/player_summary"
|
||||||
|
app:title="@string/player" />
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:icon="@drawable/ic_movie"
|
||||||
|
app:key="audio_video"
|
||||||
|
app:summary="@string/audio_video_summary"
|
||||||
app:title="@string/audio_video" />
|
app:title="@string/audio_video" />
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
|
Loading…
x
Reference in New Issue
Block a user