Skip to content

Commit

Permalink
Dismiss keyboard with clicked in empty areas (#2638)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored and bluemarvin committed Jan 23, 2020
1 parent 9ab6581 commit badff03
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -246,13 +246,19 @@ private void initialize(Context aContext) {
mKeyboardPopupTopMargin = getResources().getDimensionPixelSize(R.dimen.keyboard_key_pressed_padding) * 2;

setOnClickListener(view -> hideOverlays());
mPopupKeyboardLayer.setOnClickListener(view -> hideOverlays());
setOnTouchListener((v, event) -> {
v.performClick();
dismiss();
return true;
});

mKeyboardView.setVisibility(View.VISIBLE);
mKeyboardNumericView.setKeyboard(mKeyboardNumeric);

mPopupKeyboardLayer.setOnClickListener(view -> hideOverlays());
hideOverlays();

mBackHandler = () -> onDismiss();
mBackHandler = this::onDismiss;

mAutoCompletionView = findViewById(R.id.autoCompletionView);
mAutoCompletionView.setExtendedHeight((int)(mWidgetPlacement.height * mWidgetPlacement.density));
Expand Down Expand Up @@ -375,7 +381,7 @@ public void updateFocusedView(View aFocusedView) {
}

public void dismiss() {
exitVoiceInputMode();
exitVoiceInputMode();
if (mFocusedView != null && mFocusedView != mAttachedWindow) {
mFocusedView.clearFocus();
}
Expand Down

0 comments on commit badff03

Please sign in to comment.