From df84c3064002bb90b8e7d840afe25b6b58a64efd Mon Sep 17 00:00:00 2001 From: cyBerta Date: Fri, 4 Aug 2023 02:10:41 +0200 Subject: hide keyboard when edit text focus was lost in provider selection screen --- app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/src/main/java/se/leap/bitmaskclient/base') diff --git a/app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java b/app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java index efc6d093..145903b4 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java @@ -18,6 +18,7 @@ import android.util.Log; import android.view.View; import android.view.Window; import android.view.WindowManager; +import android.view.inputmethod.InputMethodManager; import androidx.annotation.ColorRes; import androidx.annotation.DimenRes; @@ -209,4 +210,9 @@ public class ViewHelper { animator.start(); } + public static void hideKeyboardFrom(Context context, View view) { + InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(view.getWindowToken(), 0); + } + } -- cgit v1.2.3