Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Reset keyboard layout when active editable element changes focus #1011

Merged
merged 1 commit into from
Mar 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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