mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-16 15:02:48 +00:00
Minor improvements to the inline autofill (#364)
This commit is contained in:
parent
5c4b888d00
commit
450338c080
1 changed files with 1 additions and 7 deletions
|
@ -1353,12 +1353,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
@RequiresApi(api = Build.VERSION_CODES.R)
|
@RequiresApi(api = Build.VERSION_CODES.R)
|
||||||
public InlineSuggestionsRequest onCreateInlineSuggestionsRequest(@NonNull Bundle uiExtras) {
|
public InlineSuggestionsRequest onCreateInlineSuggestionsRequest(@NonNull Bundle uiExtras) {
|
||||||
Log.d(TAG,"onCreateInlineSuggestionsRequest called");
|
Log.d(TAG,"onCreateInlineSuggestionsRequest called");
|
||||||
|
|
||||||
// Revert to default behaviour if show_suggestions is disabled
|
|
||||||
// (Maybe there is a better way to do this)
|
|
||||||
if(!mSettings.getCurrent().isSuggestionsEnabledPerUserSettings()){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return InlineAutofillUtils.createInlineSuggestionRequest(mDisplayContext);
|
return InlineAutofillUtils.createInlineSuggestionRequest(mDisplayContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1374,7 +1368,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
final View inlineSuggestionView = InlineAutofillUtils.createView(inlineSuggestions, mDisplayContext);
|
final View inlineSuggestionView = InlineAutofillUtils.createView(inlineSuggestions, mDisplayContext);
|
||||||
// "normal" suggestions might be determined in parallel when processing MSG_UPDATE_SUGGESTION_STRIP
|
// "normal" suggestions might be determined in parallel when processing MSG_UPDATE_SUGGESTION_STRIP
|
||||||
// so we add a delay to make sure inline suggestions are set only after normal suggestions
|
// so we add a delay to make sure inline suggestions are set only after normal suggestions
|
||||||
new Handler().postDelayed(() -> {
|
mHandler.postDelayed(() -> {
|
||||||
mSuggestionStripView.clear();
|
mSuggestionStripView.clear();
|
||||||
mSuggestionStripView.hideToolbarKeys();
|
mSuggestionStripView.hideToolbarKeys();
|
||||||
mSuggestionStripView.addSuggestionView(inlineSuggestionView);
|
mSuggestionStripView.addSuggestionView(inlineSuggestionView);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue