Add ExoPlayerSettingsFragment and move playback load interval size setting into it

This fragment has been added into SettingsResourceRegistry, to allow searches
in its options.

It has been placed at the place of the previous playback load interval size
setting (so in Video and Audio settings).
This commit is contained in:
AudricV 2022-08-18 18:35:22 +02:00 committed by Stypox
parent 29318c64ed
commit a4a9957a15
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
6 changed files with 42 additions and 7 deletions

View File

@ -0,0 +1,14 @@
package org.schabi.newpipe.settings;
import android.os.Bundle;
import androidx.annotation.Nullable;
public class ExoPlayerSettingsFragment extends BasePreferenceFragment {
@Override
public void onCreatePreferences(@Nullable final Bundle savedInstanceState,
@Nullable final String rootKey) {
addPreferencesFromResourceRegistry();
}
}

View File

@ -40,6 +40,7 @@ public final class SettingsResourceRegistry {
add(PlayerNotificationSettingsFragment.class, R.xml.player_notification_settings);
add(UpdateSettingsFragment.class, R.xml.update_settings);
add(VideoAudioSettingsFragment.class, R.xml.video_audio_settings);
add(ExoPlayerSettingsFragment.class, R.xml.exoplayer_settings);
}
private SettingRegistryEntry add(

View File

@ -1366,4 +1366,6 @@
</string-array>
<string name="streams_notifications_channels_key">streams_notifications_channels</string>
<string name="player_notification_screen_key">player_notification_screen</string>
<string name="exoplayer_settings_key">exoplayer_settings_key</string>
</resources>

View File

@ -773,4 +773,8 @@
<string name="feed_show_partially_watched">Partially watched</string>
<string name="feed_show_upcoming">Upcoming</string>
<string name="sort">Sort</string>
<string name="settings_category_exoplayer_title">ExoPlayer settings</string>
<string name="settings_category_exoplayer_summary">Manage some ExoPlayer settings. These changes require a player restart to take effect</string>
<string name="use_exoplayer_decoder_fallback_title">Use ExoPlayer\'s decoder fallback feature</string>
<string name="use_exoplayer_decoder_fallback_summary">Enable this option if you have decoder initialization issues, which falls back to lower-priority decoders if primary decoders initialization fail. This may result in poor playback performance than when using primary decoders</string>
</resources>

View File

@ -0,0 +1,16 @@
<?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"
android:title="@string/settings_category_exoplayer_title">
<ListPreference
android:defaultValue="@string/progressive_load_interval_default_value"
android:entries="@array/progressive_load_interval_descriptions"
android:entryValues="@array/progressive_load_interval_values"
android:key="@string/progressive_load_interval_key"
android:summary="@string/progressive_load_interval_summary"
android:title="@string/progressive_load_interval_title"
app:singleLineTitle="false"
app:iconSpaceReserved="false" />
</PreferenceScreen>

View File

@ -61,13 +61,11 @@
app:iconSpaceReserved="false"
app:useSimpleSummaryProvider="true" />
<ListPreference
android:defaultValue="@string/progressive_load_interval_default_value"
android:entries="@array/progressive_load_interval_descriptions"
android:entryValues="@array/progressive_load_interval_values"
android:key="@string/progressive_load_interval_key"
android:summary="@string/progressive_load_interval_summary"
android:title="@string/progressive_load_interval_title"
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.ExoPlayerSettingsFragment"
android:key="@string/exoplayer_settings_key"
android:summary="@string/settings_category_exoplayer_summary"
android:title="@string/settings_category_exoplayer_title"
app:singleLineTitle="false"
app:iconSpaceReserved="false" />