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
This commit is contained in:
parent
cd6ef9a8b1
commit
034c326078
1 changed files with 7 additions and 2 deletions
|
@ -743,6 +743,13 @@ public final class InputLogic {
|
||||||
final InputTransaction inputTransaction,
|
final InputTransaction inputTransaction,
|
||||||
// TODO: remove this argument
|
// TODO: remove this argument
|
||||||
final LatinIME.UIHandler handler) {
|
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;
|
final int codePoint = event.mCodePoint;
|
||||||
mSpaceState = SpaceState.NONE;
|
mSpaceState = SpaceState.NONE;
|
||||||
if (inputTransaction.mSettingsValues.isWordSeparator(codePoint)
|
if (inputTransaction.mSettingsValues.isWordSeparator(codePoint)
|
||||||
|
@ -838,8 +845,6 @@ public final class InputLogic {
|
||||||
} else {
|
} else {
|
||||||
sendKeyCodePoint(settingsValues, codePoint);
|
sendKeyCodePoint(settingsValues, codePoint);
|
||||||
}
|
}
|
||||||
// In case the "add to dictionary" hint was still displayed.
|
|
||||||
mSuggestionStripViewAccessor.dismissAddToDictionaryHint();
|
|
||||||
}
|
}
|
||||||
inputTransaction.setRequiresUpdateSuggestions();
|
inputTransaction.setRequiresUpdateSuggestions();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue