From: <gi...@cr...> - 2025-07-28 09:20:15
|
via 204c02f503a10b0d37091dd08d9445664050f487 (commit) from ec60261d0a04724e0fc73b2ba127d202725ca099 (commit) ----------------------------------------------------------------------- commit 204c02f503a10b0d37091dd08d9445664050f487 Author: Medrano83 <rob...@gm...> Date: Mon Jul 21 23:58:00 2025 +0200 Update to Android SDK 35 Starting August 31 2025, new apps and app updates must target Android 15 (API level 35) or higher to be submitted to Google Play. There are two changes related to window insets in Android 15: edge-to-edge is enforced by default, and there are also configuration changes, such as the default configuration of system bars. I'm also reworking the code to control the virtual keyboard visibility because it's a mess. ----------------------------------------------------------------------- Summary of changes: .github/workflows/ci.yml | 2 +- .../source/android-project/app/build.gradle.in | 6 +- .../main/java/org/develz/crawl/DCSSKeyboard.java | 24 ++-- .../src/main/java/org/develz/crawl/DCSSMorgue.java | 4 +- .../src/main/java/org/libsdl/app/SDLActivity.java | 133 ++++++++++----------- .../app/src/main/res/layout/keyboard_ctrl.xml | 2 +- .../app/src/main/res/layout/keyboard_numeric.xml | 2 +- .../app/src/main/res/layout/keyboard_upper.xml | 2 +- .../app/src/main/res/layout/launcher.xml | 1 + .../app/src/main/res/layout/morgue.xml | 1 + .../app/src/main/res/layout/text_editor.xml | 1 + .../app/src/main/res/layout/text_viewer.xml | 3 +- crawl-ref/source/android-project/build.gradle | 2 +- crawl-ref/source/main.cc | 2 +- crawl-ref/source/startup.cc | 2 +- crawl-ref/source/syscalls.cc | 6 +- crawl-ref/source/syscalls.h | 2 +- 17 files changed, 93 insertions(+), 102 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cf95cdb65..d457c26353 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -691,7 +691,7 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 with: - gradle-version: 8.7 # compatible with Android Gradle plugin 8.5 + gradle-version: 8.7 # compatible with Android Gradle plugin 8.6 - name: Setup ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/crawl-ref/source/android-project/app/build.gradle.in b/crawl-ref/source/android-project/app/build.gradle.in index 435779c797..f1b011b796 100644 --- a/crawl-ref/source/android-project/app/build.gradle.in +++ b/crawl-ref/source/android-project/app/build.gradle.in @@ -6,9 +6,9 @@ android { defaultConfig { applicationId "org.develz.crawl" - compileSdk 34 + compileSdk 35 minSdkVersion 21 - targetSdkVersion 34 + targetSdkVersion 35 versionCode @ANDROID_VERSION@ versionName "@CRAWL_VERSION@" @@ -55,7 +55,7 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'androidx.appcompat:appcompat:1.7.1' implementation 'com.google.android.material:material:1.12.0' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.2.1' diff --git a/crawl-ref/source/android-project/app/src/main/java/org/develz/crawl/DCSSKeyboard.java b/crawl-ref/source/android-project/app/src/main/java/org/develz/crawl/DCSSKeyboard.java index 3a29b72065..c3ae28e298 100644 --- a/crawl-ref/source/android-project/app/src/main/java/org/develz/crawl/DCSSKeyboard.java +++ b/crawl-ref/source/android-project/app/src/main/java/org/develz/crawl/DCSSKeyboard.java @@ -227,29 +227,29 @@ public class DCSSKeyboard extends DCSSKeyboardBase implements View.OnClickListen protected void updateLayout(View v) { if ((v.getId() == R.id.key_shift_lower) || (v.getId() == R.id.key_shift_ctrl)) { - keyboardLower.setVisibility(View.INVISIBLE); - keyboardCtrl.setVisibility(View.INVISIBLE); - keyboardNumeric.setVisibility(View.INVISIBLE); + keyboardLower.setVisibility(View.GONE); + keyboardCtrl.setVisibility(View.GONE); + keyboardNumeric.setVisibility(View.GONE); keyboardUpper.setVisibility(View.VISIBLE); } else if (v.getId() == R.id.key_ctrl_lower || v.getId() == R.id.key_ctrl_upper) { - keyboardLower.setVisibility(View.INVISIBLE); - keyboardUpper.setVisibility(View.INVISIBLE); - keyboardNumeric.setVisibility(View.INVISIBLE); + keyboardLower.setVisibility(View.GONE); + keyboardUpper.setVisibility(View.GONE); + keyboardNumeric.setVisibility(View.GONE); keyboardCtrl.setVisibility(View.VISIBLE); } else if ((v.getId() == R.id.key_123_lower) || (v.getId() == R.id.key_123_upper) || (v.getId() == R.id.key_123_ctrl)) { - keyboardLower.setVisibility(View.INVISIBLE); - keyboardUpper.setVisibility(View.INVISIBLE); - keyboardCtrl.setVisibility(View.INVISIBLE); + keyboardLower.setVisibility(View.GONE); + keyboardUpper.setVisibility(View.GONE); + keyboardCtrl.setVisibility(View.GONE); keyboardNumeric.setVisibility(View.VISIBLE); } else if ((v.getId() == R.id.key_abc) || (((LinearLayout)v.getParent().getParent()).getId() == R.id.keyboard_upper) || (((LinearLayout)v.getParent().getParent()).getId() == R.id.keyboard_ctrl)) { - keyboardUpper.setVisibility(View.INVISIBLE); - keyboardCtrl.setVisibility(View.INVISIBLE); - keyboardNumeric.setVisibility(View.INVISIBLE); + keyboardUpper.setVisibility(View.GONE); + keyboardCtrl.setVisibility(View.GONE); + keyboardNumeric.setVisibility(View.GONE); keyboardLower.setVisibility(View.VISIBLE); } } diff --git a/crawl-ref/source/android-project/app/src/main/java/org/develz/crawl/DCSSMorgue.java b/crawl-ref/source/android-project/app/src/main/java/org/develz/crawl/DCSSMorgue.java index 10828b0a21..6739ea4835 100644 --- a/crawl-ref/source/android-project/app/src/main/java/org/develz/crawl/DCSSMorgue.java +++ b/crawl-ref/source/android-project/app/src/main/java/org/develz/crawl/DCSSMorgue.java @@ -52,14 +52,14 @@ public class DCSSMorgue extends AppCompatActivity adapter = new DCSSMorgueAdapter(morgueDir, this); recyclerView.setAdapter(adapter); adapter.sortMorgueFiles(DEFAULT_ORDER); - progress.setVisibility(View.INVISIBLE); + progress.setVisibility(View.GONE); } @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { progress.setVisibility(View.VISIBLE); adapter.sortMorgueFiles(position); - progress.setVisibility(View.INVISIBLE); + progress.setVisibility(View.GONE); } @Override diff --git a/crawl-ref/source/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/crawl-ref/source/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index 4f1491a9c4..2bc076f0fe 100644 --- a/crawl-ref/source/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/crawl-ref/source/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -72,8 +72,8 @@ public class SDLActivity extends AppCompatActivity { protected static boolean fullScreen; protected static View mTextEdit; protected static boolean mScreenKeyboardShown; - protected static boolean mScreenExtraKeyboardShown; protected static ViewGroup mLayout; + protected static LinearLayout keyboardsLayout; protected static SDLClipboardHandler mClipboardHandler; // This is what SDL runs in. It invokes SDL_main(), eventually @@ -151,6 +151,7 @@ public class SDLActivity extends AppCompatActivity { fullScreen = true; mTextEdit = null; mLayout = null; + keyboardsLayout = null; mClipboardHandler = null; mSDLThread = null; mExitCalledFromJava = false; @@ -162,7 +163,6 @@ public class SDLActivity extends AppCompatActivity { mCurrentNativeState = NativeState.INIT; // CRAWL HACK: Custom keyboard mScreenKeyboardShown = false; - mScreenExtraKeyboardShown = false; } // Setup @@ -238,26 +238,29 @@ public class SDLActivity extends AppCompatActivity { Log.i(TAG, "Full screen: " + fullScreen); mLayout = new RelativeLayout(this); + mLayout.setFitsSystemWindows(true); mLayout.setBackgroundColor(getResources().getColor(R.color.black)); mSurface = new SDLSurface(getApplication()); mKeyboard = new DCSSKeyboard(this); + mKeyboard.setVisibility(View.INVISIBLE); mKeyboard.initKeyboard(keyboardOption, keyboardSize); mKeyboardExtra = new DCSSKeyboardExtra(this); + mKeyboardExtra.setVisibility(View.INVISIBLE); mKeyboardExtra.initKeyboard(extraKeyboardOption, keyboardSize); // Add the SDLSurface to the main layout aligned top RelativeLayout.LayoutParams sdlLParams = new RelativeLayout.LayoutParams( - RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT); + RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT); sdlLParams.addRule(RelativeLayout.ALIGN_PARENT_TOP); mSurface.setLayoutParams(sdlLParams); mLayout.addView(mSurface); // Main keyboard at the bottom and extra keyboard at the top - LinearLayout keyboardsLayout = new LinearLayout(this); + keyboardsLayout = new LinearLayout(this); keyboardsLayout.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams extraKeyLParams = new LinearLayout.LayoutParams( RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT); - if (extraKeyboardOption == 3 || extraKeyboardOption == 4) { + if (extraKeyboardOption == 0 || extraKeyboardOption >= 3) { // Space between keyboards Space space = new Space(this); LinearLayout.LayoutParams spaceLParams = new LinearLayout.LayoutParams( @@ -270,7 +273,7 @@ public class SDLActivity extends AppCompatActivity { } mKeyboardExtra.setLayoutParams(extraKeyLParams); keyboardsLayout.addView(mKeyboardExtra); - if (keyboardOption == 0 || keyboardOption == 1) { + if (keyboardOption <= 1) { LinearLayout.LayoutParams mainKeyLParams = new LinearLayout.LayoutParams( RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT); mKeyboard.setLayoutParams(mainKeyLParams); @@ -284,45 +287,6 @@ public class SDLActivity extends AppCompatActivity { keyboardsLayout.setLayoutParams(keyLParams); mLayout.addView(keyboardsLayout); setContentView(mLayout); - - // Calculate SDL Surface height - mLayout.addOnLayoutChangeListener( - (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> { - - if (mScreenKeyboardShown) { - if (mKeyboard.getVisibility() != View.VISIBLE || oldBottom != mLayout.getHeight()) { - mKeyboard.setVisibility(View.VISIBLE); - ViewGroup.LayoutParams lParams = mSurface.getLayoutParams(); - if (keyboardOption == 0) { - lParams.height = mLayout.getHeight() - mKeyboard.getHeight(); - } else { - lParams.height = mLayout.getHeight(); - } - mSurface.setLayoutParams(lParams); - } - } - else { - if (mKeyboard.getVisibility() != View.INVISIBLE || oldBottom != mLayout.getHeight()) { - mKeyboard.setVisibility(View.INVISIBLE); - ViewGroup.LayoutParams lParams = mSurface.getLayoutParams(); - lParams.height = mLayout.getHeight(); - mSurface.setLayoutParams(lParams); - } - } - - if (mScreenExtraKeyboardShown) { - mKeyboardExtra.setVisibility(View.VISIBLE); - } else { - mKeyboardExtra.setVisibility(View.INVISIBLE); - } - - // Init the TextEdit - // Transfer the task to the main thread as a Runnable - // Delay the initialization if using the soft keyboard - if (keyboardOption != 2) { - mSingleton.commandHandler.post(new ShowTextInputTask(left, top, right, bottom)); - } - }); // CRAWL HACK: Custom keyboard (END) // Get filename from "Open with" of another application @@ -366,9 +330,6 @@ public class SDLActivity extends AppCompatActivity { } SDLActivity.handleNativeState(); - - // CRAWL HACK: Force screen update - updateScreen(); } @Override @@ -575,6 +536,7 @@ public class SDLActivity extends AppCompatActivity { static final int COMMAND_UNUSED = 2; static final int COMMAND_TEXTEDIT_HIDE = 3; static final int COMMAND_SET_KEEP_SCREEN_ON = 5; + static final int COMMAND_UPDATE_KEYBOARD_VISIBILITY = 10; protected static final int COMMAND_USER = 0x8000; @@ -638,6 +600,33 @@ public class SDLActivity extends AppCompatActivity { } break; } + case COMMAND_UPDATE_KEYBOARD_VISIBILITY: + { + Log.v(TAG, "command update keyboard visibility"); + if (context instanceof Activity) { + if (mScreenKeyboardShown && keyboardOption < 2) { + mKeyboard.setVisibility(View.VISIBLE); + } else { + mKeyboard.setVisibility(View.GONE); + } + if (mScreenKeyboardShown && extraKeyboardOption > 0) { + mKeyboardExtra.setVisibility(View.VISIBLE); + } else { + mKeyboardExtra.setVisibility(View.GONE); + } + // Update SDL Surface heigh + if (keyboardOption == 0) { + ViewGroup.LayoutParams lParams = mSurface.getLayoutParams(); + if (mScreenKeyboardShown) { + lParams.height = keyboardsLayout.getHeight() - mKeyboard.getHeight(); + } else { + lParams.height = ViewGroup.LayoutParams.MATCH_PARENT; + } + mSurface.setLayoutParams(lParams); + } + } + break; + } default: if ((context instanceof SDLActivity) && !((SDLActivity) context).onUnhandledMessage(msg.arg1, msg.obj)) { Log.e(TAG, "error handling message, command is " + msg.arg1); @@ -829,41 +818,38 @@ public class SDLActivity extends AppCompatActivity { * This method is called by SDL using JNI. */ public static boolean showTextInput(int x, int y, int w, int h) { - // CRAWL HACK: Task already created on layout update - return true; // Transfer the task to the main thread as a Runnable - //return mSingleton.commandHandler.post(new ShowTextInputTask(x, y, w, h)); + return mSingleton.commandHandler.post(new ShowTextInputTask(x, y, w, h)); } // CRAWL HACK: Function used to toggle the keyboard // This method is called using JNI - public static boolean jniKeyboardControl(boolean toggle) { - Log.i(TAG, "jniKeyboardControl. Toggle = " + toggle); - // Custom keyboards - if (extraKeyboardOption > 0 && !toggle) { - mScreenExtraKeyboardShown = true; - } - if (keyboardOption == 0 || keyboardOption == 1) { - if (toggle) { - mScreenKeyboardShown = !mScreenKeyboardShown; - } else { - mScreenKeyboardShown = true; - } - return mScreenKeyboardShown; - } - // System keyboard - if (keyboardOption == 2) { + public static boolean jniKeyboardControl(int action) { + Log.i(TAG, "jniKeyboardControl. Action = " + action); + if (action == 0) { // Hide keyboard + mScreenKeyboardShown = false; + } else if (action == 1) { // Show keyboard + mScreenKeyboardShown = true; + } else if (action == 2) { // Toggle keyboard + mScreenKeyboardShown = !mScreenKeyboardShown; + } + mSingleton.sendCommand(COMMAND_UPDATE_KEYBOARD_VISIBILITY, null); + // This function always shows the system keyboard, it can be hidden with the back key + if (keyboardOption == 2 && action > 0) { mSingleton.commandHandler.post(new ShowTextInputTask((int)mSurface.getX(), (int)mSurface.getY(), mSurface.getWidth(), mSurface.getHeight())); } - return false; + return mScreenKeyboardShown; } // CRAWL HACK: Function to force a screen update public static void updateScreen() { - SDLActivity.onNativeKeyDown(KeyEvent.KEYCODE_CTRL_LEFT); - SDLActivity.onNativeKeyDown(KeyEvent.KEYCODE_R); - SDLActivity.onNativeKeyUp(KeyEvent.KEYCODE_R); - SDLActivity.onNativeKeyUp(KeyEvent.KEYCODE_CTRL_LEFT); + final Handler handler = new Handler(Looper.getMainLooper()); + handler.postDelayed(() -> { + SDLActivity.onNativeKeyDown(KeyEvent.KEYCODE_CTRL_LEFT); + SDLActivity.onNativeKeyDown(KeyEvent.KEYCODE_R); + SDLActivity.onNativeKeyUp(KeyEvent.KEYCODE_R); + SDLActivity.onNativeKeyUp(KeyEvent.KEYCODE_CTRL_LEFT); + }, 1000); } public static boolean isTextInputEvent(KeyEvent event) { @@ -1421,7 +1407,8 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, SDLActivity.handleNativeState(); - // CRAWL HACK: Force screen update + // CRAWL HACK: Update SDL Surface heigh + SDLActivity.mSingleton.sendCommand(SDLActivity.COMMAND_UPDATE_KEYBOARD_VISIBILITY, null); SDLActivity.updateScreen(); } diff --git a/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_ctrl.xml b/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_ctrl.xml index e0ebc57116..9d93eb3c04 100644 --- a/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_ctrl.xml +++ b/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_ctrl.xml @@ -6,7 +6,7 @@ android:layout_centerInParent="true" android:orientation="vertical" android:baselineAligned="false" - android:visibility="invisible"> + android:visibility="gone"> <LinearLayout android:layout_width="match_parent" diff --git a/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_numeric.xml b/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_numeric.xml index 4f239b7995..ede178f553 100644 --- a/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_numeric.xml +++ b/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_numeric.xml @@ -6,7 +6,7 @@ android:layout_centerInParent="true" android:orientation="vertical" android:baselineAligned="false" - android:visibility="invisible"> + android:visibility="gone"> <LinearLayout android:layout_width="match_parent" diff --git a/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_upper.xml b/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_upper.xml index 5e99fd7596..dbaaba96a0 100644 --- a/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_upper.xml +++ b/crawl-ref/source/android-project/app/src/main/res/layout/keyboard_upper.xml @@ -6,7 +6,7 @@ android:layout_centerInParent="true" android:orientation="vertical" android:baselineAligned="false" - android:visibility="invisible"> + android:visibility="gone"> <LinearLayout android:layout_width="match_parent" diff --git a/crawl-ref/source/android-project/app/src/main/res/layout/launcher.xml b/crawl-ref/source/android-project/app/src/main/res/layout/launcher.xml index c8d64be819..3e7188f24a 100644 --- a/crawl-ref/source/android-project/app/src/main/res/layout/launcher.xml +++ b/crawl-ref/source/android-project/app/src/main/res/layout/launcher.xml @@ -12,6 +12,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" + android:fitsSystemWindows="true" android:scrollbars="vertical"> <LinearLayout diff --git a/crawl-ref/source/android-project/app/src/main/res/layout/morgue.xml b/crawl-ref/source/android-project/app/src/main/res/layout/morgue.xml index b7a4f0b7e5..4b83e4214f 100644 --- a/crawl-ref/source/android-project/app/src/main/res/layout/morgue.xml +++ b/crawl-ref/source/android-project/app/src/main/res/layout/morgue.xml @@ -5,6 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/black" + android:fitsSystemWindows="true" android:keepScreenOn="true" tools:context=".DCSSMorgue"> diff --git a/crawl-ref/source/android-project/app/src/main/res/layout/text_editor.xml b/crawl-ref/source/android-project/app/src/main/res/layout/text_editor.xml index ef7efc27ac..1d570eab4b 100644 --- a/crawl-ref/source/android-project/app/src/main/res/layout/text_editor.xml +++ b/crawl-ref/source/android-project/app/src/main/res/layout/text_editor.xml @@ -6,6 +6,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/black" + android:fitsSystemWindows="true" android:keepScreenOn="true" tools:context=".DCSSTextEditor"> diff --git a/crawl-ref/source/android-project/app/src/main/res/layout/text_viewer.xml b/crawl-ref/source/android-project/app/src/main/res/layout/text_viewer.xml index c2cd9bfcc3..20e0a998d6 100644 --- a/crawl-ref/source/android-project/app/src/main/res/layout/text_viewer.xml +++ b/crawl-ref/source/android-project/app/src/main/res/layout/text_viewer.xml @@ -5,6 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/black" + android:fitsSystemWindows="true" android:keepScreenOn="true" tools:context=".DCSSTextViewer"> @@ -52,7 +53,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/download" - android:visibility="invisible" + android:visibility="gone" android:theme="@style/ButtonColor1" /> </LinearLayout> </LinearLayout> diff --git a/crawl-ref/source/android-project/build.gradle b/crawl-ref/source/android-project/build.gradle index 59809d2e30..2a15218883 100644 --- a/crawl-ref/source/android-project/build.gradle +++ b/crawl-ref/source/android-project/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.5.1' + classpath 'com.android.tools.build:gradle:8.6.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index 94dcab3c96..5c0884d477 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -2449,7 +2449,7 @@ void process_command(command_type cmd, command_type prev_cmd) break; case CMD_TOGGLE_KEYBOARD: - jni_keyboard_control(true); + jni_keyboard_control(2); break; #endif diff --git a/crawl-ref/source/startup.cc b/crawl-ref/source/startup.cc index 48854e6419..5a564a0d78 100644 --- a/crawl-ref/source/startup.cc +++ b/crawl-ref/source/startup.cc @@ -1039,7 +1039,7 @@ bool startup_step() #ifdef __ANDROID__ // Request the Android virtual keyboard. Waiting for the SDLActivity to be // resized avoids some display bugs. - jni_keyboard_control(false); + jni_keyboard_control(1); sleep(1); #endif diff --git a/crawl-ref/source/syscalls.cc b/crawl-ref/source/syscalls.cc index 321380aef3..c5cc2dde22 100644 --- a/crawl-ref/source/syscalls.cc +++ b/crawl-ref/source/syscalls.cc @@ -51,7 +51,7 @@ Java_org_libsdl_app_SDLActivity_nativeSaveGame( save_game(false); } -bool jni_keyboard_control(bool toggle) +bool jni_keyboard_control(int action) { JNIEnv *env = Android_JNI_GetEnv(); jclass sdlClass = env->FindClass("org/libsdl/app/SDLActivity"); @@ -60,8 +60,8 @@ bool jni_keyboard_control(bool toggle) return false; jmethodID mid = - env->GetStaticMethodID(sdlClass, "jniKeyboardControl", "(Z)Z"); - jboolean shown = env->CallStaticBooleanMethod(sdlClass, mid, toggle); + env->GetStaticMethodID(sdlClass, "jniKeyboardControl", "(I)Z"); + jboolean shown = env->CallStaticBooleanMethod(sdlClass, mid, action); return shown; } diff --git a/crawl-ref/source/syscalls.h b/crawl-ref/source/syscalls.h index 418dbb1ce9..5bcf6f9a01 100644 --- a/crawl-ref/source/syscalls.h +++ b/crawl-ref/source/syscalls.h @@ -24,7 +24,7 @@ int mkstemp(char *dummy); #endif #ifdef __ANDROID__ -bool jni_keyboard_control(bool toggle); +bool jni_keyboard_control(int toggle); #endif #ifndef CRAWL_HAVE_FDATASYNC -- Dungeon Crawl Stone Soup |