a
554325746@qq.com
2019-12-25 38492bbaa63586e2f4877da0eaa01a082fd565a6
app/src/main/java/com/basic/security/utils/KeyboardUtil.java
@@ -8,28 +8,25 @@
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import com.basic.security.activity.MainActivity;
import com.basic.security.base.BaseApplication;
import com.basic.security.fragment.helper.HomeGridViewAdapter;
public class KeyboardUtil {
    public static void showKeyboard() {
        InputMethodManager imm = (InputMethodManager)BaseApplication.getApplication().activity.getSystemService(Context.INPUT_METHOD_SERVICE);
        InputMethodManager imm = (InputMethodManager) BaseApplication.getApplication().activity.getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
    }
    public static void setupUI(final View view) {
        if (1!=1) {
            return;
        }
//        if (1!=1) {
//            return;
//        }
        // Set up touch listener for non-text box views to hide keyboard.
        if (!(view instanceof EditText)) {
            view.setOnTouchListener(new View.OnTouchListener() {
                public boolean onTouch(View v, MotionEvent event) {
                    System.out.println("KeyboardUtil.onTouch setOnTouchListener view="+v);
//                    System.out.println("KeyboardUtil.onTouch setOnTouchListener view="+v + ", parent="+view.getParent());
                    KeyboardUtil.hideSoftKeyboard();
                    return false;
                }