aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2014-08-24 19:43:47 -0700
committerYohei Yukawa <yukawa@google.com>2014-08-24 20:32:22 -0700
commit034c3260781f6f42d8f0252379d9fa6fd5c9d4d3 (patch)
treeab967ecf5ee958c898380eeb2435903ee476af28 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
parentcd6ef9a8b117b82623251510fac72ee108ec1a2a (diff)
downloadlatinime-034c3260781f6f42d8f0252379d9fa6fd5c9d4d3.tar.gz
latinime-034c3260781f6f42d8f0252379d9fa6fd5c9d4d3.tar.xz
latinime-034c3260781f6f42d8f0252379d9fa6fd5c9d4d3.zip
Dismiss "Add to dictionary" hint with non-special char event
This CL slightly extends the condition when "Add to dictionary" hint is dismissed. With this CL, "Add to dictionary hint" will be dismissed by any non-special char event. This is more comfortable especially if we start using more intrusive UIs such as indicator and/or background color with the text hint in the suggestion strip. Change-Id: I2ea0fa40d9c6663ebf5d5439be3eca2a2cbd5166
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 348bae63a..4028b2810 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -743,6 +743,13 @@ public final class InputLogic {
final InputTransaction inputTransaction,
// TODO: remove this argument
final LatinIME.UIHandler handler) {
+ // In case the "add to dictionary" hint was still displayed.
+ // TODO: Do we really need to check if we have composing text here?
+ if (!mWordComposer.isComposingWord() &&
+ mSuggestionStripViewAccessor.isShowingAddToDictionaryHint()) {
+ mSuggestionStripViewAccessor.dismissAddToDictionaryHint();
+ }
+
final int codePoint = event.mCodePoint;
mSpaceState = SpaceState.NONE;
if (inputTransaction.mSettingsValues.isWordSeparator(codePoint)
@@ -838,8 +845,6 @@ public final class InputLogic {
} else {
sendKeyCodePoint(settingsValues, codePoint);
}
- // In case the "add to dictionary" hint was still displayed.
- mSuggestionStripViewAccessor.dismissAddToDictionaryHint();
}
inputTransaction.setRequiresUpdateSuggestions();
}