[Scummvm-git-logs] scummvm master -> 53c22e4f9a6f8253abba625dbcbe2faba0669925
lephilousophe
noreply at scummvm.org
Sat Dec 18 15:32:46 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
53c22e4f9a ANDROID: Fix softkeyboard button for Chromebooks
Commit: 53c22e4f9a6f8253abba625dbcbe2faba0669925
https://github.com/scummvm/scummvm/commit/53c22e4f9a6f8253abba625dbcbe2faba0669925
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-12-18T16:32:43+01:00
Commit Message:
ANDROID: Fix softkeyboard button for Chromebooks
On a Chromebook, the keyboard may be present but hidden (not available for
use) because the device is flipped around in Tablet mode. In this case we want
the soft keyboard to be available. This change also hides the soft keyboard
button if the hardware keyboard is available, since it doesn't do anything.
Fixes #13138.
Changed paths:
backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index 9b2ad2711d..93dffe6e4b 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -62,6 +62,7 @@ import java.util.Map;
import java.util.Properties;
import java.util.TreeSet;
+import static android.content.res.Configuration.HARDKEYBOARDHIDDEN_NO;
import static android.content.res.Configuration.KEYBOARD_QWERTY;
public class ScummVMActivity extends Activity implements OnKeyboardVisibilityListener {
@@ -136,13 +137,18 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
@Override
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
- if (isHWKeyboardConnected()) {
+
+ final boolean hwKeyboard = isHWKeyboardConnected();
+ _toggleKeyboardBtnIcon.setVisibility(hwKeyboard ? View.GONE : View.VISIBLE);
+ if (hwKeyboard) {
hideScreenKeyboard();
}
}
private boolean isHWKeyboardConnected() {
- return getResources().getConfiguration().keyboard == KEYBOARD_QWERTY;
+ final Configuration config = getResources().getConfiguration();
+ return config.keyboard == KEYBOARD_QWERTY
+ && config.hardKeyboardHidden == HARDKEYBOARDHIDDEN_NO;
}
public boolean isKeyboardOverlayShown() {
@@ -1326,7 +1332,7 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
private void showToggleKeyboardBtnIcon(boolean show) {
//ImageView keyboardBtn = findViewById(R.id.show_keyboard);
if (_toggleKeyboardBtnIcon != null ) {
- if (show) {
+ if (show && !isHWKeyboardConnected()) {
_toggleKeyboardBtnIcon.setVisibility(View.VISIBLE);
} else {
_toggleKeyboardBtnIcon.setVisibility(View.GONE);
More information about the Scummvm-git-logs
mailing list