From 7f96e25ff8d6b2572d4178ebb7095c890a7bff35 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 23 May 2024 18:06:44 +0200 Subject: [PATCH] Post show/hide keyboard --- .../main/java/eu/faircode/email/Helper.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 558087ba76..24d2c150b0 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -2090,21 +2090,23 @@ public class Helper { } static void showKeyboard(final View view) { - try { - Log.i("showKeyboard view=" + view); - new SoftwareKeyboardControllerCompat(view).show(); - } catch (Throwable ex) { - Log.e(ex); - } + view.post(new RunnableEx("showKeyboard") { + @Override + protected void delegate() { + Log.i("showKeyboard view=" + view); + new SoftwareKeyboardControllerCompat(view).show(); + } + }); } static void hideKeyboard(final View view) { - try { - Log.i("hideKeyboard view=" + view); - new SoftwareKeyboardControllerCompat(view).hide(); - } catch (Throwable ex) { - Log.e(ex); - } + view.post(new RunnableEx("hideKeyboard") { + @Override + protected void delegate() { + Log.i("hideKeyboard view=" + view); + new SoftwareKeyboardControllerCompat(view).hide(); + } + }); } static boolean isKeyboardVisible(final View view) {