fix(oem): Back button to dismiss FV Android system keyboard

Bring in the changes from #2950 and #3093 to the FV Android app
This commit is contained in:
Darcy Wong 2020-05-07 10:36:20 +07:00
parent 2ff9cde7d3
commit 4e39e6c560
2 changed files with 13 additions and 0 deletions

View file

@ -21,6 +21,7 @@
# Files generated as part of the build
app/src/main/assets/packages
app/src/main/assets/keyboards.csv
app/src/main/assets/fv_all.kmp
# Legacy Eclipse IDE files
.classpath

View file

@ -185,6 +185,18 @@ public class SystemKeyboard extends InputMethodService implements KeyboardEventH
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
// Dismiss the keyboard if currently shown
if (isInputViewShown()) {
KMManager.hideSystemKeyboard();
return true;
}
break;
}
}
return interpreter.onKeyDown(keyCode, event); // if false, will revert to default handling.
}