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:
commit
fcac53cdc0
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue