new dev bug: fixed number keys typing while the language selection dialog is displayed
This commit is contained in:
parent
9e98475634
commit
2b79e6ad66
1 changed files with 11 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package io.github.sspanak.tt9.ui.dialogs;
|
package io.github.sspanak.tt9.ui.dialogs;
|
||||||
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
import android.os.Handler;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
@ -51,7 +52,7 @@ public class ChangeLanguageDialog extends PopupDialog {
|
||||||
@Override
|
@Override
|
||||||
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
|
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
|
||||||
if (Key.isBack(keyCode)) {
|
if (Key.isBack(keyCode)) {
|
||||||
close();
|
closeAsync();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,7 +73,10 @@ public class ChangeLanguageDialog extends PopupDialog {
|
||||||
if (onLanguageChanged != null) {
|
if (onLanguageChanged != null) {
|
||||||
onLanguageChanged.accept(languageId);
|
onLanguageChanged.accept(languageId);
|
||||||
}
|
}
|
||||||
close();
|
|
||||||
|
|
||||||
|
// close after returning to prevent the key event from leaking into the current input field
|
||||||
|
closeAsync();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,6 +97,11 @@ public class ChangeLanguageDialog extends PopupDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void closeAsync() {
|
||||||
|
new Handler().post(this::close);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void close() {
|
protected void close() {
|
||||||
detachRadioButtons();
|
detachRadioButtons();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue