From af1a05003a26d36703040a2e3fb4c887e675bf13 Mon Sep 17 00:00:00 2001 From: SerpentSpirale Date: Thu, 2 Sep 2021 07:02:19 +0200 Subject: [PATCH] Fix keyboard flashing white when closing --- .../net/kdt/pojavlaunch/customcontrols/TouchCharInput.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/TouchCharInput.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/TouchCharInput.java index 119f71e5c..7e98e64da 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/TouchCharInput.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/TouchCharInput.java @@ -100,15 +100,16 @@ public class TouchCharInput extends androidx.appcompat.widget.AppCompatEditText * @return if the keyboard is set to be shown. */ public boolean switchKeyboardState(){ + InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE); //If an hard keyboard is present, never trigger the soft one if(hasFocus() || (getResources().getConfiguration().keyboard == Configuration.KEYBOARD_QWERTY && getResources().getConfiguration().hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES)){ + imm.hideSoftInputFromWindow(getWindowToken(), 0); clear(); disable(); return false; }else{ - InputMethodManager imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE); enable(); imm.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT); return true;