Conversation
yausername
commented
Dec 14, 2019
- I carefully read the contribution guidelines and agree to them.
|
|
||
| private void showAddItemDialog(Context c) { | ||
| final EditText urlET = new EditText(c); | ||
| urlET.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI); |
There was a problem hiding this comment.
We could also add the no suggestions flag to disable auto correction when typing the url. But I guess most people will copy their instance urls and this flag disables the option to paste the first clipboard item from the keyboard.
What's your opinion? @Stypox @yausername
| urlET.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI); | |
| urlET.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI); | |
| urlET.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); |
There was a problem hiding this comment.
I assume most keyboards will stop suggesting things when they see a url text field. Mozilla Preview (fenix) uses the same flags in the bookmark editor: textUri means InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI (source)
So it is ok to have no TYPE_TEXT_FLAG_NO_SUGGESTIONS ;-)
There was a problem hiding this comment.
Auto correction is automatically disabled on TYPE_TEXT_VARIATION_URI. I don't see any harm is having suggestions on because many instances use dictionary words.
There was a problem hiding this comment.
Ok. I this case my keyboard is behaving shitty :)
When typing, I still get auto-corrected. Never mind, I tested with another keyboard and things work as expected.