Clipboard suggestions (#647)

This commit is contained in:
codokie 2024-07-06 00:14:54 +03:00 committed by GitHub
parent 21124a5a45
commit bdab98c2c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 213 additions and 18 deletions

View file

@ -1648,7 +1648,11 @@ public final class InputLogic {
final SuggestedWords suggestedWords = holder.get(null,
Constants.GET_SUGGESTED_WORDS_TIMEOUT);
if (suggestedWords != null) {
mSuggestionStripViewAccessor.showSuggestionStrip(suggestedWords);
// Prefer clipboard suggestions (if available and setting is enabled) over beginning of sentence predictions.
if (!(suggestedWords.mInputStyle == SuggestedWords.INPUT_STYLE_BEGINNING_OF_SENTENCE_PREDICTION
&& mLatinIME.tryShowClipboardSuggestion())) {
mSuggestionStripViewAccessor.showSuggestionStrip(suggestedWords);
}
}
if (DebugFlags.DEBUG_ENABLED) {
long runTimeMillis = System.currentTimeMillis() - startTimeMillis;