fix clipboard suggestion being shown for a split second when starting gesture typing

This commit is contained in:
Helium314 2024-07-10 16:32:18 +02:00
parent 105d044aa8
commit a3bc3b56ff
3 changed files with 18 additions and 6 deletions

View file

@ -1630,7 +1630,11 @@ public class LatinIME extends InputMethodService implements
@Override
public void showSuggestionStrip(final SuggestedWords suggestedWords) {
if (suggestedWords.isEmpty()) {
setNeutralSuggestionStrip();
// avoids showing clipboard suggestion when starting gesture typing
// should be fine, as there will be another suggestion in a few ms
// (but not a great style to avoid this visual glitch, maybe revert this commit and replace with sth better)
if (suggestedWords.mInputStyle != SuggestedWords.INPUT_STYLE_UPDATE_BATCH)
setNeutralSuggestionStrip();
} else {
setSuggestedWords(suggestedWords);
}