Merge "Update gesture suggestions even when suggestions strip is off"
commit
506259396f
|
@ -1332,13 +1332,15 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
@Override
|
@Override
|
||||||
public void onUpdateBatchInput(InputPointers batchPointers) {
|
public void onUpdateBatchInput(InputPointers batchPointers) {
|
||||||
mWordComposer.setBatchInputPointers(batchPointers);
|
mWordComposer.setBatchInputPointers(batchPointers);
|
||||||
updateSuggestionStrip();
|
final SuggestedWords suggestedWords = getSuggestedWords();
|
||||||
|
showSuggestionStrip(suggestedWords, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEndBatchInput(InputPointers batchPointers) {
|
public void onEndBatchInput(InputPointers batchPointers) {
|
||||||
mWordComposer.setBatchInputPointers(batchPointers);
|
mWordComposer.setBatchInputPointers(batchPointers);
|
||||||
final SuggestedWords suggestedWords = updateSuggestionStrip();
|
final SuggestedWords suggestedWords = getSuggestedWords();
|
||||||
|
showSuggestionStrip(suggestedWords, null);
|
||||||
if (suggestedWords == null || suggestedWords.size() == 0) {
|
if (suggestedWords == null || suggestedWords.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1691,8 +1693,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: rename this method to updateSuggestionStrip or simply updateSuggestions
|
private void updateSuggestionStrip() {
|
||||||
private SuggestedWords updateSuggestionStrip() {
|
|
||||||
mHandler.cancelUpdateSuggestionStrip();
|
mHandler.cancelUpdateSuggestionStrip();
|
||||||
|
|
||||||
// Check if we have a suggestion engine attached.
|
// Check if we have a suggestion engine attached.
|
||||||
|
@ -1702,15 +1703,21 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
+ "requested!");
|
+ "requested!");
|
||||||
mWordComposer.setAutoCorrection(mWordComposer.getTypedWord());
|
mWordComposer.setAutoCorrection(mWordComposer.getTypedWord());
|
||||||
}
|
}
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String typedWord = mWordComposer.getTypedWord();
|
|
||||||
if (!mWordComposer.isComposingWord() && !mCurrentSettings.mBigramPredictionEnabled) {
|
if (!mWordComposer.isComposingWord() && !mCurrentSettings.mBigramPredictionEnabled) {
|
||||||
setPunctuationSuggestions();
|
setPunctuationSuggestions();
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final SuggestedWords suggestedWords = getSuggestedWords();
|
||||||
|
final String typedWord = mWordComposer.getTypedWord();
|
||||||
|
showSuggestionStrip(suggestedWords, typedWord);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SuggestedWords getSuggestedWords() {
|
||||||
|
final String typedWord = mWordComposer.getTypedWord();
|
||||||
// Get the word on which we should search the bigrams. If we are composing a word, it's
|
// Get the word on which we should search the bigrams. If we are composing a word, it's
|
||||||
// whatever is *before* the half-committed word in the buffer, hence 2; if we aren't, we
|
// whatever is *before* the half-committed word in the buffer, hence 2; if we aren't, we
|
||||||
// should just skip whitespace if any, so 1.
|
// should just skip whitespace if any, so 1.
|
||||||
|
@ -1718,13 +1725,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
final CharSequence prevWord =
|
final CharSequence prevWord =
|
||||||
mConnection.getNthPreviousWord(mCurrentSettings.mWordSeparators,
|
mConnection.getNthPreviousWord(mCurrentSettings.mWordSeparators,
|
||||||
mWordComposer.isComposingWord() ? 2 : 1);
|
mWordComposer.isComposingWord() ? 2 : 1);
|
||||||
SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer,
|
final SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer,
|
||||||
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(),
|
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(),
|
||||||
mCurrentSettings.mCorrectionEnabled);
|
mCurrentSettings.mCorrectionEnabled);
|
||||||
suggestedWords = maybeRetrieveOlderSuggestions(typedWord, suggestedWords);
|
return maybeRetrieveOlderSuggestions(typedWord, suggestedWords);
|
||||||
|
|
||||||
showSuggestionStrip(suggestedWords, typedWord);
|
|
||||||
return suggestedWords;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private SuggestedWords maybeRetrieveOlderSuggestions(final CharSequence typedWord,
|
private SuggestedWords maybeRetrieveOlderSuggestions(final CharSequence typedWord,
|
||||||
|
|
Loading…
Reference in New Issue