aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2011-11-15 04:12:05 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-15 04:12:05 -0800
commit7c2cb3eb06cb97fde6614b4259235feb61f6a598 (patch)
tree6522a65ce9f020dd380381d18a6c03753287a08a /java/src
parenta8ee9386d2fdc9efc4541d6c6b9e1c991885060e (diff)
parented631627cb2337b025f0e80df6fecf1e6e511dc4 (diff)
downloadlatinime-7c2cb3eb06cb97fde6614b4259235feb61f6a598.tar.gz
latinime-7c2cb3eb06cb97fde6614b4259235feb61f6a598.tar.xz
latinime-7c2cb3eb06cb97fde6614b4259235feb61f6a598.zip
am ed631627: Double space conversion should be enabled only when the 1st space is "weak".
* commit 'ed631627cb2337b025f0e80df6fecf1e6e511dc4': Double space conversion should be enabled only when the 1st space is "weak".
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index a6a3a5c88..504dead40 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -159,7 +159,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// Magic space: a space that should disappear on space/apostrophe insertion, move after the
// punctuation on punctuation insertion, and become a real space on alpha char insertion.
- // Weak space: a space that be swapped only by suggestion strip punctuation.
+ // Weak space: a space that should be swapped only by suggestion strip punctuation.
// Double space: the state where the user pressed space twice quickly, which LatinIME
// resolved as period-space. Undoing this converts the period to a space.
// Swap punctuation: the state where a (weak or magic) space and a punctuation from the
@@ -762,6 +762,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
isSuggestionsStripVisible(), /* needsInputViewShown */ false);
// Delay updating suggestions because keyboard input view may not be shown at this point.
mHandler.postUpdateSuggestions();
+ mHandler.cancelDoubleSpacesTimer();
inputView.setKeyPreviewPopupEnabled(mSettingsValues.mKeyPreviewPopupOn,
mSettingsValues.mKeyPreviewPopupDismissDelay);
@@ -1288,6 +1289,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// all inputs that do not result in a special state. Each character handling is then
// free to override the state as they see fit.
final int spaceState = mSpaceState;
+
+ // TODO: Consolidate the double space timer, mLastKeyTime, and the space state.
+ if (primaryCode != Keyboard.CODE_SPACE) {
+ mHandler.cancelDoubleSpacesTimer();
+ }
+
switch (primaryCode) {
case Keyboard.CODE_DELETE:
mSpaceState = SPACE_STATE_NONE;