Search in sources :

Example 6 with InputMethodManager

use of android.view.inputmethod.InputMethodManager in project KitKatEmoji by chathudan.

the class MainActivity method hideKeyboard.

private void hideKeyboard() {
    InputMethodManager inputMethodManager = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMethodManager.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), 0);
}
Also used : InputMethodManager(android.view.inputmethod.InputMethodManager)

Example 7 with InputMethodManager

use of android.view.inputmethod.InputMethodManager in project KitKatEmoji by chathudan.

the class MainActivity method changeEmojiLayout.

protected void changeEmojiLayout() {
    final InputMethodManager keyboard = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    //		keyboard.showSoftInput(message, 0);
    if (isEmojiVisible && !isKeyBoardVisible) {
        emoticonsButton.setBackgroundResource(R.drawable.ic_vp_smileys);
        emojiIconsCover.setVisibility(LinearLayout.GONE);
        isEmojiVisible = false;
        mShowEmojiHandler.postDelayed(new Runnable() {

            @Override
            public void run() {
                messageEd.requestFocus();
                keyboard.showSoftInput(messageEd, 0);
                checkKeyboardHeight(parentLayout);
            }
        }, 100);
    } else if (isEmojiVisible && isKeyBoardVisible) {
    } else if (!isEmojiVisible && isKeyBoardVisible) {
        hideKeyboard();
        mShowEmojiHandler.postDelayed(new Runnable() {

            @Override
            public void run() {
                emoticonsButton.setBackgroundResource(R.drawable.ic_vp_keypad);
                emojiIconsCover.setVisibility(LinearLayout.VISIBLE);
                isEmojiVisible = true;
            }
        }, 100);
    } else if (!isEmojiVisible && !isKeyBoardVisible) {
        emoticonsButton.setBackgroundResource(R.drawable.ic_vp_keypad);
        emojiIconsCover.setVisibility(LinearLayout.VISIBLE);
        isEmojiVisible = true;
    }
}
Also used : InputMethodManager(android.view.inputmethod.InputMethodManager)

Example 8 with InputMethodManager

use of android.view.inputmethod.InputMethodManager in project KitKatEmoji by chathudan.

the class MainActivity method showKeyboard.

private void showKeyboard(View view) {
    InputMethodManager keyboard = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    keyboard.showSoftInput(view, 0);
}
Also used : InputMethodManager(android.view.inputmethod.InputMethodManager)

Example 9 with InputMethodManager

use of android.view.inputmethod.InputMethodManager in project android-app by eoecn.

the class BaseActivity method hideKeyboard.

protected void hideKeyboard(View view) {
    InputMethodManager imm = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
Also used : InputMethodManager(android.view.inputmethod.InputMethodManager)

Example 10 with InputMethodManager

use of android.view.inputmethod.InputMethodManager in project android_frameworks_base by ParanoidAndroid.

the class SearchDialog method onBackPressed.

@Override
public void onBackPressed() {
    // If the input method is covering the search dialog completely,
    // e.g. in landscape mode with no hard keyboard, dismiss just the input method
    InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
    if (imm != null && imm.isFullscreenMode() && imm.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0)) {
        return;
    }
    // Close search dialog
    cancel();
}
Also used : InputMethodManager(android.view.inputmethod.InputMethodManager)

Aggregations

InputMethodManager (android.view.inputmethod.InputMethodManager)601 View (android.view.View)113 TextView (android.widget.TextView)61 Paint (android.graphics.Paint)43 Spannable (android.text.Spannable)34 Editable (android.text.Editable)32 EditText (android.widget.EditText)30 Intent (android.content.Intent)29 ImageView (android.widget.ImageView)29 RemoteException (android.os.RemoteException)23 TextPaint (android.text.TextPaint)21 KeyEvent (android.view.KeyEvent)20 Point (android.graphics.Point)18 InputMethodInfo (android.view.inputmethod.InputMethodInfo)18 AdapterView (android.widget.AdapterView)17 Button (android.widget.Button)17 RemoteView (android.widget.RemoteViews.RemoteView)16 Resources (android.content.res.Resources)15 ListView (android.widget.ListView)15 InputMethodSubtype (android.view.inputmethod.InputMethodSubtype)14