bugfix in the android keyboard for multiline documents

This commit is contained in:
kr.angelov
2014-03-05 13:42:55 +00:00
parent 472cbe74ec
commit 189318bf25

View File

@@ -169,7 +169,7 @@ public class TranslatorInputMethodService extends InputMethodService
updateShiftKeyState(attribute); updateShiftKeyState(attribute);
} }
mActionId = attribute.imeOptions & EditorInfo.IME_MASK_ACTION; mActionId = attribute.imeOptions & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION);
mCurKeyboard.setImeOptions(getResources(), attribute.imeOptions); mCurKeyboard.setImeOptions(getResources(), attribute.imeOptions);
mInstance = this; mInstance = this;
@@ -392,7 +392,10 @@ public class TranslatorInputMethodService extends InputMethodService
current.setShifted(false); current.setShifted(false);
} }
} else if (primaryCode == 10) { } else if (primaryCode == 10) {
getCurrentInputConnection().performEditorAction(mActionId); if ((mActionId & EditorInfo.IME_FLAG_NO_ENTER_ACTION) == 0)
getCurrentInputConnection().performEditorAction(mActionId & EditorInfo.IME_MASK_ACTION);
else
handleCharacter(primaryCode, keyCodes);
} else if (primaryCode == ' ' && mComposing.length() == 0) { } else if (primaryCode == ' ' && mComposing.length() == 0) {
getCurrentInputConnection().commitText(" ", 1); getCurrentInputConnection().commitText(" ", 1);
} else { } else {
@@ -489,7 +492,10 @@ public class TranslatorInputMethodService extends InputMethodService
} }
mComposing.append((char) primaryCode); mComposing.append((char) primaryCode);
getCurrentInputConnection().setComposingText(mComposing, 1); if (primaryCode == 10)
commitTyped(getCurrentInputConnection());
else
getCurrentInputConnection().setComposingText(mComposing, 1);
updateShiftKeyState(getCurrentInputEditorInfo()); updateShiftKeyState(getCurrentInputEditorInfo());
if (mPredictionOn) { if (mPredictionOn) {