ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.6k stars 2.23k forks source link

In Text Field with one line, "Enter" on physical keyboard should validate the action #16872

Closed Arthur-Milchior closed 4 weeks ago

Arthur-Milchior commented 2 months ago

I'll first give you the example that I currently care about, while I test AnkiDroid in the emulator, then the general request.

 Examples

Create Deck

How to reproduce:

Expected result:

Actual result:

Automatic backup

Expected

Actual:

General case

More generally, we should look at all text field/text input that has either:

Note to contributors

If you want to be assigned this issue, please don't hesitate to tell us that you'll only work on one single part of the issue. There seems to be a dozen of part of the code to correct. I don't know how many part can be corrected at once, and how many requires distinct code change. Also, don't hesitate to do small commits/PR, that solve only one part of the problem, so that we can iterate quickly

david-allison commented 2 months ago

any TextInputEditTExt with android:maxLines="1". That is, dialog_tts_voices dialog_tts_voices_voice and dialog_generic_text_input.xml (I admit I don't know TTS and don't know which dialog it corresponds to)

A dialog accessible via {{tts-voices:}} in the card template

MinusMallard commented 2 months ago

@Arthur-Milchior hey I was the one who edited the "create deck" text field(#16704) few weeks ago maybe I should look into it

Arthur-Milchior commented 2 months ago

Thanks @MinusMallard

MinusMallard commented 2 months ago

@Arthur-Milchior I have done some edits pressing "enter" directly presses on screen ok button and pressing "tab" button on keyboard changes focus to the on screen ok button( earlier pressing "tab" button on physical keyboard was changing focus to cancel) reference: https://developer.android.com/develop/ui/views/touch-and-input/keyboard-input/navigation

https://github.com/user-attachments/assets/983d91d1-77b0-4823-86dc-b0d4364924ed

Arthur-Milchior commented 2 months ago

I think that tab should move to "cancel", this is what seems to be the natural order according to screen. And if "enter" validates the input, there seems to be no need to make another fast way to do okay

SanjaySargam commented 4 weeks ago

Issue resolved