Skip to content

Commit

Permalink
Reset keyboard layout when active editable element changes focus (#1011)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and bluemarvin committed Mar 14, 2019
1 parent f76a9d8 commit b59dd13
Showing 1 changed file with 10 additions and 7 deletions.
Expand Up @@ -201,16 +201,19 @@ public void setBrowserWidget(UIWidget aWidget) {
}
}

private void resetKeyboardLayout() {
((CustomKeyboard)mKeyboardview.getKeyboard()).setImeOptions(mEditorInfo.imeOptions);
if ((mEditorInfo.inputType & EditorInfo.TYPE_CLASS_NUMBER) == EditorInfo.TYPE_CLASS_NUMBER)
mKeyboardview.setKeyboard(mKeyboardSymbols1);
else
mKeyboardview.setKeyboard(mKeyboardQuerty);
}

public void updateFocusedView(View aFocusedView) {
mFocusedView = aFocusedView;
if (aFocusedView != null && aFocusedView.onCheckIsTextEditor()) {
mInputConnection = aFocusedView.onCreateInputConnection(mEditorInfo);
((CustomKeyboard)mKeyboardview.getKeyboard()).setImeOptions(mEditorInfo.imeOptions);
if ((mEditorInfo.inputType & EditorInfo.TYPE_CLASS_NUMBER) == EditorInfo.TYPE_CLASS_NUMBER)
mKeyboardview.setKeyboard(mKeyboardSymbols1);
else
mKeyboardview.setKeyboard(mKeyboardQuerty);

resetKeyboardLayout();
} else {
mInputConnection = null;
}
Expand Down Expand Up @@ -544,7 +547,7 @@ private void postInputCommand(Runnable aRunnable) {

@Override
public void restartInput(@NonNull GeckoSession session, int reason) {

resetKeyboardLayout();
}

@Override
Expand Down

0 comments on commit b59dd13

Please sign in to comment.