From bf04f15d397871d75f8dec64f6fb490c8d72b446 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 2 Oct 2019 14:01:43 +0200 Subject: [PATCH] Hide keyboard before showing the color picker On some devices the keyboard is shown erroneously before the dialog --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 931c5f43bc..cef024e899 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1050,6 +1050,10 @@ public class FragmentCompose extends FragmentBase { Log.i("Style action=" + action); if (action == R.id.menu_color) { + InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Activity.INPUT_METHOD_SERVICE); + if (imm != null) + imm.hideSoftInputFromWindow(etBody.getWindowToken(), 0); + Bundle args = new Bundle(); args.putInt("color", Color.TRANSPARENT); args.putString("title", getString(R.string.title_style_color));