mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-31 10:01:22 +01:00
Added advanced option to force English language
This commit is contained in:
@@ -105,6 +105,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
private SwitchCompat swLight;
|
||||
private Button btnSound;
|
||||
|
||||
private SwitchCompat swEnglish;
|
||||
private SwitchCompat swUpdates;
|
||||
private SwitchCompat swDebug;
|
||||
|
||||
@@ -182,6 +183,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
swLight = view.findViewById(R.id.swLight);
|
||||
btnSound = view.findViewById(R.id.btnSound);
|
||||
|
||||
swEnglish = view.findViewById(R.id.swEnglish);
|
||||
swUpdates = view.findViewById(R.id.swUpdates);
|
||||
swDebug = view.findViewById(R.id.swDebug);
|
||||
|
||||
@@ -247,6 +249,18 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
}
|
||||
});
|
||||
|
||||
swEnglish.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("english", checked).commit(); // apply won't work here
|
||||
|
||||
Intent intent = new Intent(getContext(), ActivityMain.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
Runtime.getRuntime().exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
swUpdates.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -634,6 +648,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
swNotifyPreview.setEnabled(Helper.isPro(getContext()));
|
||||
swSearchLocal.setChecked(prefs.getBoolean("search_local", false));
|
||||
swLight.setChecked(prefs.getBoolean("light", false));
|
||||
swEnglish.setChecked(prefs.getBoolean("english", false));
|
||||
swUpdates.setChecked(prefs.getBoolean("updates", true));
|
||||
swUpdates.setVisibility(Helper.isPlayStoreInstall(getContext()) ? View.GONE : View.VISIBLE);
|
||||
swDebug.setChecked(prefs.getBoolean("debug", false));
|
||||
|
||||
Reference in New Issue
Block a user