diff options
author | cyBerta <cyberta@riseup.net> | 2023-08-04 02:10:41 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2023-08-04 02:10:41 +0200 |
commit | df84c3064002bb90b8e7d840afe25b6b58a64efd (patch) | |
tree | 71e717e77cc2812bb5463d56affc5977c7eb9db3 /app/src/main/java/se/leap/bitmaskclient/base | |
parent | 84ed5d88e7d04379af5975f3a8af76ef4010d8c7 (diff) |
hide keyboard when edit text focus was lost in provider selection screen
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/base')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java | 6 |
1 files changed, 6 insertions, 0 deletions
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); + } + } |