aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/RichInputConnection.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-09-18 18:36:12 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-18 18:36:13 -0700
commitc9923430ed94ff83abb759e231fbe3dd976de952 (patch)
tree8977deb5365edf4b036ea4a9b50af1c125b41cb3 /java/src/com/android/inputmethod/latin/RichInputConnection.java
parent246d227c5d19549cb00a8ee84e20d09ea00e14f4 (diff)
parentd461bfd6601dfb6d4a4f78be0ff129597af895ff (diff)
downloadlatinime-c9923430ed94ff83abb759e231fbe3dd976de952.tar.gz
latinime-c9923430ed94ff83abb759e231fbe3dd976de952.tar.xz
latinime-c9923430ed94ff83abb759e231fbe3dd976de952.zip
Merge "Support the gesture + phantom space case (A13)" into jb-mr1-dev
Diffstat (limited to 'java/src/com/android/inputmethod/latin/RichInputConnection.java')
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputConnection.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java
index cbc6a93fa..28c0c0f16 100644
--- a/java/src/com/android/inputmethod/latin/RichInputConnection.java
+++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java
@@ -209,7 +209,16 @@ public class RichInputConnection {
final boolean hasSpaceBefore) {
mIC = mParent.getCurrentInputConnection();
if (null == mIC) return Constants.TextUtils.CAP_MODE_OFF;
- if (!TextUtils.isEmpty(mComposingText)) return Constants.TextUtils.CAP_MODE_OFF;
+ if (!TextUtils.isEmpty(mComposingText)) {
+ if (hasSpaceBefore) {
+ // If we have some composing text and a space before, then we should have
+ // MODE_CHARACTERS and MODE_WORDS on.
+ return (TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_WORDS) & inputType;
+ } else {
+ // We have some composing text - we should be in MODE_CHARACTERS only.
+ return TextUtils.CAP_MODE_CHARACTERS & inputType;
+ }
+ }
// TODO: this will generally work, but there may be cases where the buffer contains SOME
// information but not enough to determine the caps mode accurately. This may happen after
// heavy pressing of delete, for example DEFAULT_TEXT_CACHE_SIZE - 5 times or so.