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);
}
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;
}
}
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);
}
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);
}
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();
}
Aggregations