mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 00:20:32 +00:00
Disabling night theme selection if auto theme is not used
This commit is contained in:
parent
aad5e26f31
commit
a2f2d562f6
@ -44,7 +44,12 @@ public class AppearanceSettingsFragment extends BasePreferenceFragment {
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
removePreference(nightThemeKey);
|
||||
// disable the night theme selection
|
||||
final Preference preference = findPreference(nightThemeKey);
|
||||
if (preference != null) {
|
||||
preference.setEnabled(false);
|
||||
preference.setSummary(getString(R.string.night_theme_available));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,13 +66,6 @@ public class AppearanceSettingsFragment extends BasePreferenceFragment {
|
||||
return super.onPreferenceTreeClick(preference);
|
||||
}
|
||||
|
||||
private void removePreference(final String preferenceKey) {
|
||||
final Preference preference = findPreference(preferenceKey);
|
||||
if (preference != null) {
|
||||
getPreferenceScreen().removePreference(preference);
|
||||
}
|
||||
}
|
||||
|
||||
private void applyThemeChange(final String beginningThemeKey,
|
||||
final String themeKey,
|
||||
final Object newValue) {
|
||||
|
@ -714,6 +714,7 @@
|
||||
<string name="auto_device_theme_title">Automatic (device theme)</string>
|
||||
<string name="night_theme_summary">Select your favorite night theme — %s</string>
|
||||
<string name="select_night_theme_toast">You can select your favorite night theme below</string>
|
||||
<string name="night_theme_available">This option is only available if Automatic (Device Theme) is selected for Theme</string>
|
||||
<string name="download_has_started">Download has started</string>
|
||||
<string name="description_select_note">You can now select text inside the description. Note that the page may flicker and links may not be clickable while in selection mode.</string>
|
||||
<string name="description_select_enable">Enable selecting text in the description</string>
|
||||
|
Loading…
Reference in New Issue
Block a user