Example usage for android.view.inputmethod InputMethodManager HIDE_NOT_ALWAYS

List of usage examples for android.view.inputmethod InputMethodManager HIDE_NOT_ALWAYS

Introduction

In this page you can find the example usage for android.view.inputmethod InputMethodManager HIDE_NOT_ALWAYS.

Prototype

int HIDE_NOT_ALWAYS

To view the source code for android.view.inputmethod InputMethodManager HIDE_NOT_ALWAYS.

Click Source Link

Document

Flag for #hideSoftInputFromWindow and InputMethodService#requestShowSelf(int) to indicate that the soft input window should normally be hidden, unless it was originally shown with #SHOW_FORCED .

Usage

From source file:com.gikoo5.hyphenate.ui.RobotsActivity.java

@Override
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.em_fragment_robots);
    inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    mListView = (ListView) findViewById(R.id.list);
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout);
    swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
            android.R.color.holo_green_light, android.R.color.holo_orange_light,
            android.R.color.holo_red_light);
    progressBar = findViewById(R.id.progress_bar);
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {

        @Override//  www.  ja v  a 2 s  . com
        public void onRefresh() {
            getRobotNamesFromServer();
        }
    });
    Map<String, RobotUser> robotMap = EMHelper.getInstance().getRobotList();
    if (robotMap != null) {
        robotList.addAll(robotMap.values());
    } else {
        progressBar.setVisibility(View.VISIBLE);
        getRobotNamesFromServer();
    }
    adapter = new RobotAdapter(this, 1, robotList);
    mListView.setAdapter(adapter);
    mListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            RobotUser user = (RobotUser) parent.getItemAtPosition(position);
            Intent intent = new Intent();
            intent.setClass(RobotsActivity.this, ChatActivity.class);
            intent.putExtra("userId", user.getUsername());
            startActivity(intent);
        }
    });
    mListView.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (getWindow()
                    .getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) {
                if (getCurrentFocus() != null)
                    inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
                            InputMethodManager.HIDE_NOT_ALWAYS);
            }
            return false;
        }
    });
}

From source file:com.avcall.app.ui.RobotsActivity.java

@Override
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.em_fragment_robots);
    inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    ListView mListView = (ListView) findViewById(R.id.list);
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout);
    if (android.os.Build.VERSION.SDK_INT >= 14) {
        swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
                android.R.color.holo_green_light, android.R.color.holo_orange_light,
                android.R.color.holo_red_light);
    }//from   w  w  w.j a  v a2 s  . co  m
    progressBar = findViewById(R.id.progress_bar);
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh() {
            getRobotNamesFromServer();
        }
    });
    Map<String, RobotUser> robotMap = AvcallHelper.getInstance().getRobotList();
    if (robotMap != null) {
        robotList.addAll(robotMap.values());
    } else {
        progressBar.setVisibility(View.VISIBLE);
        getRobotNamesFromServer();
    }
    adapter = new RobotAdapter(this, 1, robotList);
    mListView.setAdapter(adapter);
    mListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            RobotUser user = (RobotUser) parent.getItemAtPosition(position);
            Intent intent = new Intent();
            intent.setClass(RobotsActivity.this, ChatActivity.class);
            intent.putExtra("userId", user.getUsername());
            startActivity(intent);
        }
    });
    mListView.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (getWindow()
                    .getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) {
                if (getCurrentFocus() != null)
                    inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
                            InputMethodManager.HIDE_NOT_ALWAYS);
            }
            return false;
        }
    });
}

From source file:com.oasis.sdk.activity.OasisSdkPayEpinActivity.java

private void check() {
    // ?/*from  w  w  w .  ja v a  2s.c o  m*/
    InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(et_code.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
    String code = et_code.getText().toString().trim();
    if (TextUtils.isEmpty(code)) {
        BaseUtils.showMsg(this,
                getString(BaseUtils.getResourceValue("string", "oasisgames_sdk_epin_notice_5")));
        return;
    }
    setWaitScreen(true);
    HttpService.instance().postEpinCode(code.toUpperCase(), new MyCallback(this));
}

From source file:cn.wyl.superwechat.ui.RobotsActivity.java

@Override
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.em_fragment_robots);
    inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
    ListView mListView = (ListView) findViewById(R.id.list);
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout);
    if (android.os.Build.VERSION.SDK_INT >= 14) {
        swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
                android.R.color.holo_green_light, android.R.color.holo_orange_light,
                android.R.color.holo_red_light);
    }//from  www .ja va  2 s .  c  o m
    progressBar = findViewById(R.id.progress_bar);
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh() {
            getRobotNamesFromServer();
        }
    });
    Map<String, RobotUser> robotMap = SuperWeChatHelper.getInstance().getRobotList();
    if (robotMap != null) {
        robotList.addAll(robotMap.values());
    } else {
        progressBar.setVisibility(View.VISIBLE);
        getRobotNamesFromServer();
    }
    adapter = new RobotAdapter(this, 1, robotList);
    mListView.setAdapter(adapter);
    mListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            RobotUser user = (RobotUser) parent.getItemAtPosition(position);
            Intent intent = new Intent();
            intent.setClass(RobotsActivity.this, ChatActivity.class);
            intent.putExtra("userId", user.getUsername());
            startActivity(intent);
        }
    });
    mListView.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (getWindow()
                    .getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) {
                if (getCurrentFocus() != null)
                    inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
                            InputMethodManager.HIDE_NOT_ALWAYS);
            }
            return false;
        }
    });
}

From source file:com.lykj.weixun.ui.chat.ui.RobotsActivity.java

@Override
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.em_fragment_robots);
    inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
    ListView mListView = (ListView) findViewById(R.id.list);
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout);
    if (android.os.Build.VERSION.SDK_INT >= 14) {
        swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
                android.R.color.holo_green_light, android.R.color.holo_orange_light,
                android.R.color.holo_red_light);
    }//from  w  w  w.j av  a 2 s  .  c o m
    progressBar = findViewById(R.id.progress_bar);
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh() {
            getRobotNamesFromServer();
        }
    });
    Map<String, RobotUser> robotMap = DemoHelper.getInstance().getRobotList();
    if (robotMap != null) {
        robotList.addAll(robotMap.values());
    } else {
        progressBar.setVisibility(View.VISIBLE);
        getRobotNamesFromServer();
    }
    adapter = new RobotAdapter(this, 1, robotList);
    mListView.setAdapter(adapter);
    mListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            RobotUser user = (RobotUser) parent.getItemAtPosition(position);
            Intent intent = new Intent();
            intent.setClass(RobotsActivity.this, ChatActivity.class);
            intent.putExtra("userId", user.getUsername());
            startActivity(intent);
        }
    });
    mListView.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (getWindow()
                    .getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) {
                if (getCurrentFocus() != null)
                    inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
                            InputMethodManager.HIDE_NOT_ALWAYS);
            }
            return false;
        }
    });
}

From source file:com.abroad.ruianju.im.ui.RobotsActivity.java

@Override
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.em_fragment_robots);
    inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    ListView mListView = (ListView) findViewById(R.id.list);
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout);
    if (android.os.Build.VERSION.SDK_INT >= 14) {
        swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
                android.R.color.holo_green_light, android.R.color.holo_orange_light,
                android.R.color.holo_red_light);
    }/*from  w  w  w. ja va  2 s . c  om*/
    progressBar = findViewById(R.id.progress_bar);
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh() {
            getRobotNamesFromServer();
        }
    });
    Map<String, RobotUser> robotMap = DemoHelper.getInstance().getRobotList();
    if (robotMap != null) {
        robotList.addAll(robotMap.values());
    } else {
        progressBar.setVisibility(View.VISIBLE);
        getRobotNamesFromServer();
    }
    adapter = new RobotAdapter(this, 1, robotList);
    mListView.setAdapter(adapter);
    mListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            RobotUser user = (RobotUser) parent.getItemAtPosition(position);
            Intent intent = new Intent();
            intent.setClass(RobotsActivity.this, ChatActivity.class);
            intent.putExtra("userId", user.getUsername());
            startActivity(intent);
        }
    });
    mListView.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (getWindow()
                    .getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) {
                if (getCurrentFocus() != null)
                    inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
                            InputMethodManager.HIDE_NOT_ALWAYS);
            }
            return false;
        }
    });
}

From source file:com.zhou.superwechat.ui.RobotsActivity.java

@Override
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.em_fragment_robots);
    inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    ListView mListView = (ListView) findViewById(R.id.list);
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout);
    if (android.os.Build.VERSION.SDK_INT >= 14) {
        swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
                android.R.color.holo_green_light, android.R.color.holo_orange_light,
                android.R.color.holo_red_light);
    }/*from w w w  . ja  v  a  2s . c  om*/
    progressBar = findViewById(R.id.progress_bar);
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh() {
            getRobotNamesFromServer();
        }
    });
    Map<String, RobotUser> robotMap = SuperWeChatHelper.getInstance().getRobotList();
    if (robotMap != null) {
        robotList.addAll(robotMap.values());
    } else {
        progressBar.setVisibility(View.VISIBLE);
        getRobotNamesFromServer();
    }
    adapter = new RobotAdapter(this, 1, robotList);
    mListView.setAdapter(adapter);
    mListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            RobotUser user = (RobotUser) parent.getItemAtPosition(position);
            Intent intent = new Intent();
            intent.setClass(RobotsActivity.this, ChatActivity.class);
            intent.putExtra("userId", user.getUsername());
            startActivity(intent);
        }
    });
    mListView.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (getWindow()
                    .getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) {
                if (getCurrentFocus() != null)
                    inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
                            InputMethodManager.HIDE_NOT_ALWAYS);
            }
            return false;
        }
    });
}

From source file:com.cj.arcard.ui.RobotsActivity.java

@Override
@TargetApi(14)/*  ww  w .  ja  v a  2 s .  c o m*/
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.em_fragment_robots);
    inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
    ListView mListView = (ListView) findViewById(R.id.list);
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout);
    if (android.os.Build.VERSION.SDK_INT >= 14) {
        swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
                android.R.color.holo_green_light, android.R.color.holo_orange_light,
                android.R.color.holo_red_light);
    }
    progressBar = findViewById(R.id.progress_bar);
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh() {
            getRobotNamesFromServer();
        }
    });
    Map<String, RobotUser> robotMap = DemoHelper.getInstance().getRobotList();
    if (robotMap != null) {
        robotList.addAll(robotMap.values());
    } else {
        progressBar.setVisibility(View.VISIBLE);
        getRobotNamesFromServer();
    }
    adapter = new RobotAdapter(this, 1, robotList);
    mListView.setAdapter(adapter);
    mListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            RobotUser user = (RobotUser) parent.getItemAtPosition(position);
            Intent intent = new Intent();
            intent.setClass(RobotsActivity.this, ChatActivity.class);
            intent.putExtra("userId", user.getUsername());
            startActivity(intent);
        }
    });
    mListView.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (getWindow()
                    .getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) {
                if (getCurrentFocus() != null)
                    inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
                            InputMethodManager.HIDE_NOT_ALWAYS);
            }
            return false;
        }
    });
}

From source file:cn.hbm.superwechat.activity.RobotsActivity.java

@Override
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.fragment_robots);
    inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
    mListView = (ListView) findViewById(R.id.list);
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout);
    swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
            android.R.color.holo_green_light, android.R.color.holo_orange_light,
            android.R.color.holo_red_light);
    progressBar = findViewById(R.id.progress_bar);
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {

        @Override/*from  www.  j av a  2  s . co m*/
        public void onRefresh() {
            getRobotNamesFromServer();
        }
    });
    Map<String, RobotUser> robotMap = ((DemoHXSDKHelper) HXSDKHelper.getInstance()).getRobotList();
    if (robotMap != null) {
        robotList.addAll(robotMap.values());
    } else {
        progressBar.setVisibility(View.VISIBLE);
        getRobotNamesFromServer();
    }
    adapter = new RobotAdapter(this, 1, robotList);
    mListView.setAdapter(adapter);
    mListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            RobotUser user = (RobotUser) parent.getItemAtPosition(position);
            Intent intent = new Intent();
            intent.setClass(RobotsActivity.this, ChatActivity.class);
            intent.putExtra("userId", user.getUsername());
            startActivity(intent);
        }
    });
    mListView.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (getWindow()
                    .getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) {
                if (getCurrentFocus() != null)
                    inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
                            InputMethodManager.HIDE_NOT_ALWAYS);
            }
            return false;
        }
    });
}

From source file:cn.ucai.wechat.ui.RobotsActivity.java

@Override
@TargetApi(14)//www .  j av  a2 s .c o m
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.em_fragment_robots);
    inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
    ListView mListView = (ListView) findViewById(R.id.list);
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout);
    if (android.os.Build.VERSION.SDK_INT >= 14) {
        swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
                android.R.color.holo_green_light, android.R.color.holo_orange_light,
                android.R.color.holo_red_light);
    }
    progressBar = findViewById(R.id.progress_bar);
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh() {
            getRobotNamesFromServer();
        }
    });
    Map<String, RobotUser> robotMap = WeChatHelper.getInstance().getRobotList();
    if (robotMap != null) {
        robotList.addAll(robotMap.values());
    } else {
        progressBar.setVisibility(View.VISIBLE);
        getRobotNamesFromServer();
    }
    adapter = new RobotAdapter(this, 1, robotList);
    mListView.setAdapter(adapter);
    mListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            RobotUser user = (RobotUser) parent.getItemAtPosition(position);
            Intent intent = new Intent();
            intent.setClass(RobotsActivity.this, ChatActivity.class);
            intent.putExtra("userId", user.getUsername());
            startActivity(intent);
        }
    });
    mListView.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (getWindow()
                    .getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) {
                if (getCurrentFocus() != null)
                    inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
                            InputMethodManager.HIDE_NOT_ALWAYS);
            }
            return false;
        }
    });
}