[Scummvm-git-logs] scummvm branch-2-5 -> a1d2d421a4980cb896aa1bc460c517630368d5a3
aquadran
noreply at scummvm.org
Sun Dec 19 12:50:13 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:
a1d2d421a4 ANDROID: Fix softkeyboard button for Chromebooks
Commit: a1d2d421a4980cb896aa1bc460c517630368d5a3
https://github.com/scummvm/scummvm/commit/a1d2d421a4980cb896aa1bc460c517630368d5a3
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-12-19T13:49:46+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 b472540ac8..b2bb9f71fa 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() {
@@ -1310,7 +1316,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