Fix a bug where suggestion strip pick would reset magic space
Bug: 4391347 Change-Id: I93c3c821d3ab78a300edc3d251ce7b1ee0dc3958main
parent
9fbfd58773
commit
4f3b59711f
|
@ -1579,11 +1579,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
// pressed space on purpose of displaying the suggestion strip punctuation.
|
// pressed space on purpose of displaying the suggestion strip punctuation.
|
||||||
final char primaryCode = suggestion.charAt(0);
|
final char primaryCode = suggestion.charAt(0);
|
||||||
final int toLeft = (ic == null) ? 0 : ic.getTextBeforeCursor(1, 0).charAt(0);
|
final int toLeft = (ic == null) ? 0 : ic.getTextBeforeCursor(1, 0).charAt(0);
|
||||||
|
final boolean oldMagicSpace = mJustAddedMagicSpace;
|
||||||
if (Keyboard.CODE_SPACE == toLeft) mJustAddedMagicSpace = true;
|
if (Keyboard.CODE_SPACE == toLeft) mJustAddedMagicSpace = true;
|
||||||
onCodeInput(primaryCode, new int[] { primaryCode },
|
onCodeInput(primaryCode, new int[] { primaryCode },
|
||||||
KeyboardActionListener.NOT_A_TOUCH_COORDINATE,
|
KeyboardActionListener.NOT_A_TOUCH_COORDINATE,
|
||||||
KeyboardActionListener.NOT_A_TOUCH_COORDINATE);
|
KeyboardActionListener.NOT_A_TOUCH_COORDINATE);
|
||||||
mJustAddedMagicSpace = false;
|
mJustAddedMagicSpace = oldMagicSpace;
|
||||||
if (ic != null) {
|
if (ic != null) {
|
||||||
ic.endBatchEdit();
|
ic.endBatchEdit();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue