mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Small optimization.
This will avoid some two-way IPC calls. Change-Id: If9eb3e99b3d08346aadd4bbed2a1761f8c2527b9
This commit is contained in:
parent
32b56fd34d
commit
72b358aa90
@ -1075,12 +1075,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
|
|
||||||
private boolean maybeDoubleSpace() {
|
private boolean maybeDoubleSpace() {
|
||||||
if (mCurrentSettings.mCorrectionMode == Suggest.CORRECTION_NONE) return false;
|
if (mCurrentSettings.mCorrectionMode == Suggest.CORRECTION_NONE) return false;
|
||||||
|
if (!mHandler.isAcceptingDoubleSpaces()) return false;
|
||||||
final CharSequence lastThree = mConnection.getTextBeforeCursor(3, 0);
|
final CharSequence lastThree = mConnection.getTextBeforeCursor(3, 0);
|
||||||
if (lastThree != null && lastThree.length() == 3
|
if (lastThree != null && lastThree.length() == 3
|
||||||
&& canBeFollowedByPeriod(lastThree.charAt(0))
|
&& canBeFollowedByPeriod(lastThree.charAt(0))
|
||||||
&& lastThree.charAt(1) == Keyboard.CODE_SPACE
|
&& lastThree.charAt(1) == Keyboard.CODE_SPACE
|
||||||
&& lastThree.charAt(2) == Keyboard.CODE_SPACE
|
&& lastThree.charAt(2) == Keyboard.CODE_SPACE) {
|
||||||
&& mHandler.isAcceptingDoubleSpaces()) {
|
|
||||||
mHandler.cancelDoubleSpacesTimer();
|
mHandler.cancelDoubleSpacesTimer();
|
||||||
mConnection.deleteSurroundingText(2, 0);
|
mConnection.deleteSurroundingText(2, 0);
|
||||||
mConnection.commitText(". ", 1);
|
mConnection.commitText(". ", 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user