If !mWordComposer.isComposingWord(), then mWordComposer.getTypedWord()
will always return an empty string.
Change-Id: Ife66d0abc44c743cbc30d31724e833cda168fd5c
This is not exactly the same logically speaking, because it's
theoretically possible that the composing state changed in between
the message enqueueing and it's retrieval. However in the practice,
if the composing state changed the message *must* have been
cancelled and resent, else the behavior breaks. So this actually
is more robust, and removes some obscure requirements on the
calling code.
In the practice, it should also make the cancelUpdateSuggestionStrip
message useless, although this change does not yet remove it.
Change-Id: I75141920ce64e38e2f92e9c02b6c979936eee9a9
We just resetted the composing state - updating suggestions
is sure to yield no results. We may as well not call
updateSuggestions at all.
We should however still cancel any lingering timer from a
previous input field, to avoid this useless processing.
Change-Id: Ic1a19d577903d792bb797c837cc517ea8d430e75
If the separator is not a space, then we will always call
setPunctuationSuggestions and reset the suggestion strip anyway.
If the separator is a space, then the cursor has a space on
the left, which means isCursorTouchingWord depends only on
whether it touches a word on the right. If we were displaying
the "add to dictionary hint", it means a suggestion was just
chosen, so it had to be displayed, and that requires a composing
word and no non-separator at the right of the cursor.
In the end, if we go through this postUpdateSuggestions call,
we are sure we will reset the suggestions later in this method,
either by calling postUpdateBigramPredictions, or
setPunctuationSuggestions.
Change-Id: I95d5f77a5d0ac6d1a6ced8d67d6ac8f650db4a32
Just after this, clear() will be called, removing the suggestion
strip from the screen. It will later be displayed again through
onStartInputView, which will update its content.
Change-Id: I15c23ad2adecab76b0791d7fc222d15b6533f3bd
The responsivity is better like this. This does not seem to
feel slow as the previous comment seemed to indicate.
Also remove a stale comment.
Change-Id: I4e7bf9fe28716e112db182e44b3fa88ee4526bb4
After reverting an auto-correct we always have a separator after
the previously inserted word, and the cursor is never touching
a word. Showing predictions is the right thing to do, while
calling postUpdateSuggestions will invariably yield an invariably
blank suggestion strip, which is not very helpful.
Likewise, after we pick a suggestion, we should be showing the
predictions unless showing the addToDictionary hint. There was
a bug here in the corner case that the word would be a candidate
for user dictionary, but the user dictionary provider is not
available: in this case we should be showing predictions, but
we were showing an unhelpful empty suggestion bar.
Change-Id: I287bb5eb4af762bd5a433e85e185fab6d203e91a