android: misc changes (#876)

* android: add appCategory attribute

* android: remove unnecessary @TargetApi

* android: replace 'for' loop with enhanced 'for'

* android: use java-style array declaration
This commit is contained in:
scribam 2023-01-15 20:44:47 +01:00 committed by GitHub
parent 4bbf5c562e
commit cbffc5cade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -42,6 +42,7 @@
android:banner="@drawable/ic_banner"
android:logo="@drawable/ic_banner"
android:hardwareAccelerated="true"
android:appCategory="game"
android:isGame="true"
android:requestLegacyExternalStorage="true">

View File

@ -24,13 +24,13 @@ public class Emulator extends Application {
public static int vibrationDuration = 20;
public static int maple_devices[] = {
public static int[] maple_devices = {
MDT_None,
MDT_None,
MDT_None,
MDT_None
};
public static int maple_expansion_devices[][] = {
public static int[][] maple_expansion_devices = {
{ MDT_None, MDT_None },
{ MDT_None, MDT_None },
{ MDT_None, MDT_None },
@ -67,9 +67,9 @@ public class Emulator extends Application {
public static boolean micPluggedIn() {
JNIdc.getControllers(maple_devices, maple_expansion_devices);
for (int i = 0; i < maple_expansion_devices.length; i++)
if (maple_expansion_devices[i][0] == MDT_Microphone
|| maple_expansion_devices[i][1] == MDT_Microphone)
for (int[] maple_expansion_device : maple_expansion_devices)
if (maple_expansion_device[0] == MDT_Microphone
|| maple_expansion_device[1] == MDT_Microphone)
return true;
return false;
}

View File

@ -29,7 +29,6 @@ public class NativeGLView extends SurfaceView implements SurfaceHolder.Callback
vjoyDelegate.restoreCustomVjoyValues(vjoy_d_cached);
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public NativeGLView(Context context) {
this(context, null);
}

View File

@ -111,7 +111,7 @@ public final class InputDeviceManager implements InputManager.InputDeviceListene
public native boolean joystickAxisEvent(int id, int button, int value);
public native void mouseEvent(int xpos, int ypos, int buttons);
public native void mouseScrollEvent(int scrollValue);
private native void joystickAdded(int id, String name, int maple_port, String uniqueId, int fullAxes[], int halfAxes[]);
private native void joystickAdded(int id, String name, int maple_port, String uniqueId, int[] fullAxes, int[] halfAxes);
private native void joystickRemoved(int id);
public native boolean keyboardEvent(int key, boolean pressed);
public native void keyboardText(int c);