Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically disable auto-suggestions on Gboard

Tags:

android

gboard

I'm trying to programmatically disable suggestions with setInputType() using InputType TYPE_TEXT_FLAG_NO_SUGGESTIONS.

While this works for most keyboards, this doesn't work when using the "Gboard" keyboard; even with this input type, suggestions always appear. The problem is that the user can choose if he wants to have suggestions on input fields, regardless of the input type specified by the EditText.

How can the suggestions be suppressed for all keyboards, including Gboard?

like image 369
SuisJeux Avatar asked Aug 02 '17 13:08

SuisJeux


People also ask

How do I disable clipboard paste suggestions in Gboard programmatically?

If you're using the beta version of Gboard, where the feature is currently available, head into Settings > System > Languages & input > Virtual keyboard > Gboard > Clipboard and disable the Show recently copied text and images in suggestions bar option. Clipboard suggestions should now be turned off for you.

How do I turn off autofill on Gboard?

Users can enable or disable autofill as well as change the autofill service by navigating to Settings > System > Languages & input > Advanced > Input assistance > Autofill service.

How do I turn off Google Keyboard suggestions?

On Android To do so, open Gboard settings > Text correction. Turn off the toggle for “Show suggestion strip“. The word suggestions bar now won't appear while typing.


1 Answers

I found a solution :

view.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);

However you can see a little Font difference between an Input with suggestions and without.

like image 72
SuisJeux Avatar answered Sep 27 '22 22:09

SuisJeux