Merge pull request #9488 from Jared234/9353_night_theme_selection

Disabling night theme selection if auto theme is not used
This commit is contained in:
Tobi 2022-12-25 22:19:02 +01:00 committed by GitHub
commit fcac53cdc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -44,7 +44,13 @@ 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,
getString(R.string.auto_device_theme_title)));
}
}
}
@ -61,13 +67,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) {

View File

@ -716,6 +716,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 %s 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>