Skip to content

fix add instance dialog#2868

Merged
TobiGr merged 1 commit intoTeamNewPipe:devfrom
yausername:fix-add-instance-dialog
Dec 15, 2019
Merged

fix add instance dialog#2868
TobiGr merged 1 commit intoTeamNewPipe:devfrom
yausername:fix-add-instance-dialog

Conversation

@yausername
Copy link
Contributor

@yausername yausername mentioned this pull request Dec 14, 2019

private void showAddItemDialog(Context c) {
final EditText urlET = new EditText(c);
urlET.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Suggested change
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);

Copy link
Member

@Stypox Stypox Dec 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again :)

@TobiGr TobiGr merged commit f995ba1 into TeamNewPipe:dev Dec 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants