summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java11
1 files changed, 11 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 ed7bd9f2..e04ba70d 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
@@ -229,8 +229,19 @@ public class ViewHelper {
}
public static void hideKeyboardFrom(Context context, View view) {
+ if (context == null) {
+ return;
+ }
InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
+ public static boolean isKeyboardShown(Context context) {
+ if (context == null) {
+ return false;
+ }
+ InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
+ return imm.isActive();
+ }
+
}