]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/utils/Globals.java
major refactor, make account summary and transaction list fragments, part of the...
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / utils / Globals.java
index b7fffadf4b0c150153dbaff3df711d707ae22923..e32a4321247261207e8286ae20ae309b49e55ee5 100644 (file)
 
 package net.ktnx.mobileledger.utils;
 
+import android.app.Activity;
+import android.content.Context;
 import android.support.annotation.ColorInt;
+import android.view.View;
+import android.view.inputmethod.InputMethodManager;
 
 public final class Globals {
     @ColorInt
@@ -26,5 +30,14 @@ public final class Globals {
     public static int table_row_odd_bg;
     @ColorInt
     public static int primaryDark, defaultTextColor;
+    public static void hideSoftKeyboard(Activity act) {
+        // hide the keyboard
+        View v = act.getCurrentFocus();
+        if (v != null) {
+            InputMethodManager imm =
+                    (InputMethodManager) act.getSystemService(Context.INPUT_METHOD_SERVICE);
+            imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
+        }
+    }
 
 }
\ No newline at end of file