diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 2872b154f8..6610f48910 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -43,6 +43,7 @@ import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CompoundButton; +import android.widget.ImageButton; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; @@ -83,6 +84,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private TextView tvFtsIndexed; private TextView tvFtsPro; private Spinner spLanguage; + private ImageButton ibResetLanguage; private SwitchCompat swWatchdog; private SwitchCompat swUpdates; private SwitchCompat swExperiments; @@ -162,6 +164,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc tvFtsIndexed = view.findViewById(R.id.tvFtsIndexed); tvFtsPro = view.findViewById(R.id.tvFtsPro); spLanguage = view.findViewById(R.id.spLanguage); + ibResetLanguage = view.findViewById(R.id.ibResetLanguage); swWatchdog = view.findViewById(R.id.swWatchdog); swUpdates = view.findViewById(R.id.swUpdates); swExperiments = view.findViewById(R.id.swExperiments); @@ -268,6 +271,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc } }); + ibResetLanguage.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + prefs.edit().remove("language").commit(); // apply won't work here + } + }); + swWatchdog.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index 83265c711e..f3a98108ca 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -127,12 +127,26 @@ + +