the language popup will now be shown by default when there are 3 or more enabled languages
This commit is contained in:
parent
28c827f68e
commit
abd4112b8f
2 changed files with 10 additions and 3 deletions
|
|
@ -32,10 +32,12 @@ public class QuickSwitchLanguagePreference extends SwitchPreferenceCompat {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(Context context) {
|
private void init(Context context) {
|
||||||
setDefaultValue(true);
|
SettingsStore settings = new SettingsStore(context);
|
||||||
|
|
||||||
|
setDefaultValue(settings.getQuickSwitchLanguage());
|
||||||
setKey("pref_quick_switch_language");
|
setKey("pref_quick_switch_language");
|
||||||
setTitle(R.string.pref_quick_switch_language);
|
setTitle(R.string.pref_quick_switch_language);
|
||||||
setSummary(R.string.pref_quick_switch_language_summary);
|
setSummary(R.string.pref_quick_switch_language_summary);
|
||||||
setVisible(!new SettingsStore(context).isMainLayoutStealth());
|
setVisible(!settings.isMainLayoutStealth());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ public class SettingsUI extends SettingsTyping {
|
||||||
|
|
||||||
public final static int MIN_WIDTH_PERCENT = 50;
|
public final static int MIN_WIDTH_PERCENT = 50;
|
||||||
private int DEFAULT_WIDTH_LANDSCAPE = 0;
|
private int DEFAULT_WIDTH_LANDSCAPE = 0;
|
||||||
|
private Boolean DEFAULT_QUICK_SWITCH_LANGUAGE = null;
|
||||||
|
|
||||||
|
|
||||||
SettingsUI(Context context) {
|
SettingsUI(Context context) {
|
||||||
|
|
@ -88,7 +89,11 @@ public class SettingsUI extends SettingsTyping {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getQuickSwitchLanguage() {
|
public boolean getQuickSwitchLanguage() {
|
||||||
return prefs.getBoolean("pref_quick_switch_language", true);
|
if (DEFAULT_QUICK_SWITCH_LANGUAGE == null) {
|
||||||
|
DEFAULT_QUICK_SWITCH_LANGUAGE = !isMainLayoutStealth() && getEnabledLanguagesIdsAsStrings().size() <= 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
return prefs.getBoolean("pref_quick_switch_language", DEFAULT_QUICK_SWITCH_LANGUAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSettingsFontSize() {
|
public int getSettingsFontSize() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue