diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 0727fdc9a2..3ff32fdfd9 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -208,6 +208,7 @@ import static android.app.Activity.RESULT_CANCELED; import static android.app.Activity.RESULT_FIRST_USER; import static android.app.Activity.RESULT_OK; import static android.system.OsConstants.ENOSPC; +import static android.view.inputmethod.EditorInfo.IME_FLAG_NO_FULLSCREEN; import static android.widget.AdapterView.INVALID_POSITION; public class FragmentCompose extends FragmentBase { @@ -754,6 +755,17 @@ public class FragmentCompose extends FragmentBase { //if (beige && !Helper.isDarkTheme(getContext())) // view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); + boolean keyboard_no_fullscreen = prefs.getBoolean("keyboard_no_fullscreen", false); + if (keyboard_no_fullscreen) { + // https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_FULLSCREEN + etExtra.setImeOptions(etExtra.getImeOptions() | IME_FLAG_NO_FULLSCREEN); + etTo.setImeOptions(etTo.getImeOptions() | IME_FLAG_NO_FULLSCREEN); + etCc.setImeOptions(etCc.getImeOptions() | IME_FLAG_NO_FULLSCREEN); + etBcc.setImeOptions(etBcc.getImeOptions() | IME_FLAG_NO_FULLSCREEN); + etSubject.setImeOptions(etSubject.getImeOptions() | IME_FLAG_NO_FULLSCREEN); + etBody.setImeOptions(etBody.getImeOptions() | IME_FLAG_NO_FULLSCREEN); + } + etExtra.setHint(""); tvDomain.setText(null); tvPlainTextOnly.setVisibility(View.GONE); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java index a52c9b5597..e6d1cc62e8 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java @@ -43,6 +43,7 @@ import androidx.preference.PreferenceManager; public class FragmentOptionsSend extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener { private SwitchCompat swKeyboard; + private SwitchCompat swKeyboardNoFullscreen; private SwitchCompat swSuggestSent; private SwitchCompat swSuggestReceived; private SwitchCompat swSuggestFrequently; @@ -72,7 +73,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc private SwitchCompat swLookupMx; private final static String[] RESET_OPTIONS = new String[]{ - "keyboard", "suggest_sent", "suggested_received", "suggest_frequently", + "keyboard", "keyboard_no_fullscreen", "suggest_sent", "suggested_received", "suggest_frequently", "send_reminders", "send_delayed", "compose_font", "prefix_once", "separate_reply", "extended_reply", "write_below", "quote_reply", "quote_limit", "resize_reply", "signature_location", "signature_reply", "signature_forward", @@ -92,6 +93,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc // Get controls swKeyboard = view.findViewById(R.id.swKeyboard); + swKeyboardNoFullscreen = view.findViewById(R.id.swKeyboardNoFullscreen); swSuggestSent = view.findViewById(R.id.swSuggestSent); swSuggestReceived = view.findViewById(R.id.swSuggestReceived); swSuggestFrequently = view.findViewById(R.id.swSuggestFrequently); @@ -133,6 +135,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc } }); + swKeyboardNoFullscreen.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("keyboard_no_fullscreen", checked).apply(); + } + }); + swSuggestSent.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -392,6 +401,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); swKeyboard.setChecked(prefs.getBoolean("keyboard", true)); + swKeyboardNoFullscreen.setChecked(prefs.getBoolean("keyboard_no_fullscreen", false)); swSuggestSent.setChecked(prefs.getBoolean("suggest_sent", true)); swSuggestReceived.setChecked(prefs.getBoolean("suggest_received", false)); swSuggestFrequently.setChecked(prefs.getBoolean("suggest_frequently", false)); diff --git a/app/src/main/res/layout/fragment_options_send.xml b/app/src/main/res/layout/fragment_options_send.xml index 46073b13b2..6ef8572510 100644 --- a/app/src/main/res/layout/fragment_options_send.xml +++ b/app/src/main/res/layout/fragment_options_send.xml @@ -41,6 +41,17 @@ app:layout_constraintTop_toBottomOf="@id/tvCaptionGeneral" app:switchPadding="12dp" /> + + + app:layout_constraintTop_toBottomOf="@id/swKeyboardNoFullscreen" /> Automatically tune the keep-alive interval Show keyboard by default + Prevent fullscreen keyboard Suggest locally stored contacts Suggest addresses found in sent messages Suggest addresses found in received messages