Skip to content

Commit

Permalink
YUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
yechaoa committed Dec 8, 2017
1 parent 221ee97 commit 918d6f6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/src/main/java/com/yechaoa/yutils/YUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
Expand Down Expand Up @@ -240,6 +241,17 @@ public static boolean isNetWorkAvailable() {
}


/**
* 关闭软键盘
*/
public static void closeSoftKeyboard(){
InputMethodManager inputManger = (InputMethodManager) ActivityUtil.getCurrentActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
if (inputManger!=null){
inputManger.hideSoftInputFromWindow(ActivityUtil.getCurrentActivity().getWindow().getDecorView().getWindowToken(), 0);
}
}


/**
* showToast 底部显示(默认)
*/
Expand Down

0 comments on commit 918d6f6

Please sign in to comment.