namndev / QDict

This is an open source Android dictionary application which support 'stardict' format dictionaries.
https://www.namndev.com/2015-05-13-qdict/
82 stars 32 forks source link

Do not pass key events to the drop_list. #14

Open marmistrz opened 4 years ago

marmistrz commented 4 years ago

This causes the EditText to lose focus while typing, especially on devices with a hardware keyboard.


PR comments:

This change made it possible for me to use QDict on a device with a hardware keyboard :)

More precisely: on a device with a hardware keyboard every key press would result in the text field losing focus and the first item of the drop_list. A workaround was to use the virtual keyboard. However, the issue sometimes also occurred when using the virtual keyboard.

To be honest, I don't understand the purpose of passing they key events to the drop_list. It seems impossible to select any item from the drop_list while typing in the EditText, so it doesn't make much sense to check for drop_list.selectedItemPosition.

Moreover, the whole condition from the if will usually evaluate to true for any key, regardless of the drop list state. Perhaps you meant && instead of ||, but I still don't get your intention.

marmistrz commented 4 years ago

ping

marmistrz commented 3 years ago

ping