Skip to content

Instantly share code, notes, and snippets.

@lmller
Last active August 29, 2017 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmller/dd143275f88cad8a21f96843cfca0d58 to your computer and use it in GitHub Desktop.
Save lmller/dd143275f88cad8a21f96843cfca0d58 to your computer and use it in GitHub Desktop.
Samsung Devices ignore TYPE_TEXT_FLAG_NO_SUGGESTIONS, so TYPE_TEXT_VARIATION_VISIBLE_PASSWORD is the only thing that works for them.
public class SuggestionsCorrector {
public static final String SAMSUNG = "samsung";
public EditText correctSuggestions(EditText editText) {
if(Build.BRAND.equalsIgnoreCase(SAMSUNG)) {
editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
}
return editText;
}
}
@Over17
Copy link

Over17 commented Aug 29, 2017

Found out this code breaks Korean input. With "visible password", the Google Korean keyboard is showing latin symbols only.
Just something to consider when using this hack for Samsungs ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment