diff --git a/forge-gui-android/libs/arm64-v8a/libgdx-box2d.so b/forge-gui-android/libs/arm64-v8a/libgdx-box2d.so index 9fe83039884..c105a3d016a 100644 Binary files a/forge-gui-android/libs/arm64-v8a/libgdx-box2d.so and b/forge-gui-android/libs/arm64-v8a/libgdx-box2d.so differ diff --git a/forge-gui-android/libs/arm64-v8a/libgdx-freetype.so b/forge-gui-android/libs/arm64-v8a/libgdx-freetype.so index 1a2b34ff4e2..b96f619c9a2 100644 Binary files a/forge-gui-android/libs/arm64-v8a/libgdx-freetype.so and b/forge-gui-android/libs/arm64-v8a/libgdx-freetype.so differ diff --git a/forge-gui-android/libs/arm64-v8a/libgdx.so b/forge-gui-android/libs/arm64-v8a/libgdx.so index 9df8b027c47..9ace0938dde 100644 Binary files a/forge-gui-android/libs/arm64-v8a/libgdx.so and b/forge-gui-android/libs/arm64-v8a/libgdx.so differ diff --git a/forge-gui-android/libs/armeabi-v7a/libgdx-box2d.so b/forge-gui-android/libs/armeabi-v7a/libgdx-box2d.so index 82f2cee2ea0..bfbd0e8ee9e 100644 Binary files a/forge-gui-android/libs/armeabi-v7a/libgdx-box2d.so and b/forge-gui-android/libs/armeabi-v7a/libgdx-box2d.so differ diff --git a/forge-gui-android/libs/armeabi-v7a/libgdx-freetype.so b/forge-gui-android/libs/armeabi-v7a/libgdx-freetype.so index 62a2aebae2c..74a2475f80d 100644 Binary files a/forge-gui-android/libs/armeabi-v7a/libgdx-freetype.so and b/forge-gui-android/libs/armeabi-v7a/libgdx-freetype.so differ diff --git a/forge-gui-android/libs/armeabi-v7a/libgdx.so b/forge-gui-android/libs/armeabi-v7a/libgdx.so index 005705b3a23..6d173a281ae 100644 Binary files a/forge-gui-android/libs/armeabi-v7a/libgdx.so and b/forge-gui-android/libs/armeabi-v7a/libgdx.so differ diff --git a/forge-gui-android/libs/gdx-backend-android-sources.jar b/forge-gui-android/libs/gdx-backend-android-sources.jar index 0f96bb27b4d..57f507547e3 100644 Binary files a/forge-gui-android/libs/gdx-backend-android-sources.jar and b/forge-gui-android/libs/gdx-backend-android-sources.jar differ diff --git a/forge-gui-android/libs/gdx-backend-android.jar b/forge-gui-android/libs/gdx-backend-android.jar index f734d365cb4..7aff00ecfc1 100644 Binary files a/forge-gui-android/libs/gdx-backend-android.jar and b/forge-gui-android/libs/gdx-backend-android.jar differ diff --git a/forge-gui-android/libs/gdx-controllers-android.jar b/forge-gui-android/libs/gdx-controllers-android.jar index 7ebd2b4df97..b6eebf2d5eb 100644 Binary files a/forge-gui-android/libs/gdx-controllers-android.jar and b/forge-gui-android/libs/gdx-controllers-android.jar differ diff --git a/forge-gui-android/libs/gdx-freetype.jar b/forge-gui-android/libs/gdx-freetype.jar index daf2f4f1d70..eceb1b32fb7 100644 Binary files a/forge-gui-android/libs/gdx-freetype.jar and b/forge-gui-android/libs/gdx-freetype.jar differ diff --git a/forge-gui-android/libs/gdx-sources.jar b/forge-gui-android/libs/gdx-sources.jar index 11bed47689d..5caca4c850c 100644 Binary files a/forge-gui-android/libs/gdx-sources.jar and b/forge-gui-android/libs/gdx-sources.jar differ diff --git a/forge-gui-android/libs/gdx.jar b/forge-gui-android/libs/gdx.jar index 50d65286c35..a8592dd5847 100644 Binary files a/forge-gui-android/libs/gdx.jar and b/forge-gui-android/libs/gdx.jar differ diff --git a/forge-gui-android/libs/x86/libgdx-box2d.so b/forge-gui-android/libs/x86/libgdx-box2d.so index 4b80ce2fd6a..ac39a271f90 100644 Binary files a/forge-gui-android/libs/x86/libgdx-box2d.so and b/forge-gui-android/libs/x86/libgdx-box2d.so differ diff --git a/forge-gui-android/libs/x86/libgdx-freetype.so b/forge-gui-android/libs/x86/libgdx-freetype.so index 0d5a244fa40..4d7fa109dcc 100644 Binary files a/forge-gui-android/libs/x86/libgdx-freetype.so and b/forge-gui-android/libs/x86/libgdx-freetype.so differ diff --git a/forge-gui-android/libs/x86/libgdx.so b/forge-gui-android/libs/x86/libgdx.so index 7fbd858dd76..702092ea0d3 100644 Binary files a/forge-gui-android/libs/x86/libgdx.so and b/forge-gui-android/libs/x86/libgdx.so differ diff --git a/forge-gui-android/libs/x86_64/libgdx-box2d.so b/forge-gui-android/libs/x86_64/libgdx-box2d.so index 04fbd2ca6af..53b97c0281a 100644 Binary files a/forge-gui-android/libs/x86_64/libgdx-box2d.so and b/forge-gui-android/libs/x86_64/libgdx-box2d.so differ diff --git a/forge-gui-android/libs/x86_64/libgdx-freetype.so b/forge-gui-android/libs/x86_64/libgdx-freetype.so index ca5b553d52e..9ebfc7035dc 100644 Binary files a/forge-gui-android/libs/x86_64/libgdx-freetype.so and b/forge-gui-android/libs/x86_64/libgdx-freetype.so differ diff --git a/forge-gui-android/libs/x86_64/libgdx.so b/forge-gui-android/libs/x86_64/libgdx.so index c93c34d8d3b..635cff6a132 100644 Binary files a/forge-gui-android/libs/x86_64/libgdx.so and b/forge-gui-android/libs/x86_64/libgdx.so differ diff --git a/forge-gui-android/pom.xml b/forge-gui-android/pom.xml index 102c04e6a3f..416e7ff9639 100644 --- a/forge-gui-android/pom.xml +++ b/forge-gui-android/pom.xml @@ -209,7 +209,7 @@ com.badlogicgames.gdx-controllers gdx-controllers-android - 2.2.3 + 2.2.4 system ${pom.basedir}/libs/gdx-controllers-android.jar diff --git a/forge-gui-android/proguard.cfg b/forge-gui-android/proguard.cfg index c02f96825a0..e27735afa2a 100644 --- a/forge-gui-android/proguard.cfg +++ b/forge-gui-android/proguard.cfg @@ -89,6 +89,7 @@ -keepclassmembers class com.badlogic.gdx.physics.box2d.World { boolean contactFilter(long, long); + boolean getUseDefaultContactFilter(); void beginContact(long); void endContact(long); void preSolve(long, long); diff --git a/forge-gui-android/src/com/badlogic/gdx/backends/android/AndroidApplication.java b/forge-gui-android/src/com/badlogic/gdx/backends/android/AndroidApplication.java index 3f08d5cd83b..699dda355fb 100644 --- a/forge-gui-android/src/com/badlogic/gdx/backends/android/AndroidApplication.java +++ b/forge-gui-android/src/com/badlogic/gdx/backends/android/AndroidApplication.java @@ -55,8 +55,7 @@ public class AndroidApplication extends Activity implements AndroidApplicationBa protected boolean firstResume = true; protected final Array runnables = new Array(); protected final Array executedRunnables = new Array(); - protected final SnapshotArray lifecycleListeners = new SnapshotArray( - LifecycleListener.class); + protected final SnapshotArray lifecycleListeners = new SnapshotArray<>(LifecycleListener[]::new); private final Array androidEventListeners = new Array(); protected int logLevel = LOG_INFO; protected ApplicationLogger applicationLogger; @@ -295,8 +294,8 @@ public class AndroidApplication extends Activity implements AndroidApplicationBa @Override protected void onDestroy () { - super.onDestroy(); keyboardHeightProvider.close(); + super.onDestroy(); } @Override diff --git a/forge-gui-android/src/com/badlogic/gdx/backends/android/DefaultAndroidInput.java b/forge-gui-android/src/com/badlogic/gdx/backends/android/DefaultAndroidInput.java index 7828c995430..7eac411a8e7 100644 --- a/forge-gui-android/src/com/badlogic/gdx/backends/android/DefaultAndroidInput.java +++ b/forge-gui-android/src/com/badlogic/gdx/backends/android/DefaultAndroidInput.java @@ -17,6 +17,7 @@ package com.badlogic.gdx.backends.android; import android.animation.Animator; +import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.Activity; import android.app.AlertDialog; @@ -63,6 +64,7 @@ import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.Pool; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** An implementation of the {@link Input} interface for Android. @@ -114,9 +116,9 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput, public static final int NUM_TOUCHES = 20; - ArrayList keyListeners = new ArrayList(); - ArrayList keyEvents = new ArrayList(); - ArrayList touchEvents = new ArrayList(); + ArrayList keyListeners = new ArrayList<>(); + ArrayList keyEvents = new ArrayList<>(); + ArrayList touchEvents = new ArrayList<>(); int[] touchX = new int[NUM_TOUCHES]; int[] touchY = new int[NUM_TOUCHES]; int[] deltaX = new int[NUM_TOUCHES]; @@ -126,17 +128,16 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput, int[] realId = new int[NUM_TOUCHES]; float[] pressure = new float[NUM_TOUCHES]; final boolean hasMultitouch; - private boolean[] justPressedButtons = new boolean[NUM_TOUCHES]; + private final boolean[] justPressedButtons = new boolean[NUM_TOUCHES]; private SensorManager manager; public boolean accelerometerAvailable = false; protected final float[] accelerometerValues = new float[3]; public boolean gyroscopeAvailable = false; protected final float[] gyroscopeValues = new float[3]; - private Handler handle; + private final Handler handle; final Application app; final Context context; protected final AndroidTouchHandler touchHandler; - private int sleepTime = 0; protected final AndroidHaptics haptics; private boolean compassAvailable = false; private boolean rotationVectorAvailable = false; @@ -158,12 +159,12 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput, private SensorEventListener compassListener; private SensorEventListener rotationVectorListener; - private final ArrayList genericMotionListeners = new ArrayList(); + private final ArrayList genericMotionListeners = new ArrayList<>(); private final AndroidMouseHandler mouseHandler; public DefaultAndroidInput (Application activity, Context context, Object view, AndroidApplicationConfiguration config) { // we hook into View, for LWPs we call onTouch below directly from - // within the AndroidLivewallpaperEngine#onTouchEvent() method. + // within the AndroidWallpaperEngine#onTouchEvent() method. if (view instanceof View) { View v = (View)view; v.setOnKeyListener(this); @@ -181,7 +182,6 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput, handle = new Handler(); this.app = activity; this.context = context; - this.sleepTime = config.touchSleepTime; touchHandler = new AndroidTouchHandler(); hasMultitouch = touchHandler.supportsMultitouch(context); @@ -403,15 +403,11 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput, synchronized (this) { if (justTouched) { justTouched = false; - for (int i = 0; i < justPressedButtons.length; i++) { - justPressedButtons[i] = false; - } + Arrays.fill(justPressedButtons, false); } if (keyJustPressed) { keyJustPressed = false; - for (int i = 0; i < justPressedKeys.length; i++) { - justPressedKeys[i] = false; - } + Arrays.fill(justPressedKeys, false); } if (processor != null) { @@ -491,6 +487,7 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput, boolean requestFocus = true; + @SuppressLint("ClickableViewAccessibility") @Override public boolean onTouch (View view, MotionEvent event) { if (requestFocus && view != null) { @@ -502,51 +499,9 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput, // synchronized in handler.postTouchEvent() touchHandler.onTouch(event, this); - if (sleepTime != 0) { - try { - Thread.sleep(sleepTime); - } catch (InterruptedException e) { - } - } return true; } -// TODO Seems unused. Delete when confirmed. -// /** Called in {@link AndroidLiveWallpaperService} on tap -// * @param x -// * @param y */ -// public void onTap (int x, int y) { -// postTap(x, y); -// } -// -// /** Called in {@link AndroidLiveWallpaperService} on drop -// * @param x -// * @param y */ -// public void onDrop (int x, int y) { -// postTap(x, y); -// } -// -// protected void postTap (int x, int y) { -// synchronized (this) { -// TouchEvent event = usedTouchEvents.obtain(); -// event.timeStamp = System.nanoTime(); -// event.pointer = 0; -// event.x = x; -// event.y = y; -// event.type = TouchEvent.TOUCH_DOWN; -// touchEvents.add(event); -// -// event = usedTouchEvents.obtain(); -// event.timeStamp = System.nanoTime(); -// event.pointer = 0; -// event.x = x; -// event.y = y; -// event.type = TouchEvent.TOUCH_UP; -// touchEvents.add(event); -// } -// Gdx.app.getGraphics().requestRendering(); -// } - @Override public boolean onKey (View v, int keyCode, android.view.KeyEvent e) { for (int i = 0, n = keyListeners.size(); i < n; i++) @@ -680,9 +635,6 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput, DisplayMetrics metrics = new DisplayMetrics(); androidApplication.getWindowManager().getDefaultDisplay().getMetrics(metrics); int usableHeight = metrics.heightPixels; - int sdkVersion = android.os.Build.VERSION.SDK_INT; - if (sdkVersion < 17) return usableHeight; - androidApplication.getWindowManager().getDefaultDisplay().getRealMetrics(metrics); int realHeight = metrics.heightPixels; @@ -1036,7 +988,7 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput, final String text = editText.getText().toString(); final int selection = editText.getSelectionStart(); Gdx.app.postRunnable(new Runnable() { - TextInputWrapper wrapper = textInputWrapper; + final TextInputWrapper wrapper = textInputWrapper; @Override public void run () { @@ -1145,7 +1097,7 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput, * SensorManager#getRotationMatrix(float[], float[], float[], float[]). Does not manipulate the matrix * if the platform does not have an accelerometer and compass, or a rotation vector sensor. - * @param matrix */ + * @param matrix the device's rotation matrix */ public void getRotationMatrix (float[] matrix) { if (rotationVectorAvailable) SensorManager.getRotationMatrixFromVector(matrix, rotationVectorValues); @@ -1323,7 +1275,7 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput, StringBuilder sb = new StringBuilder(); for (int i = 0; i < len; i++) { - sb.append(i + ":" + realId[i] + " "); + sb.append(i).append(":").append(realId[i]).append(" "); } Gdx.app.log("AndroidInput", "Pointer ID lookup failed: " + pointerId + ", " + sb.toString()); return -1; diff --git a/forge-gui-ios/libs/gdx-backend-robovm-sources.jar b/forge-gui-ios/libs/gdx-backend-robovm-sources.jar index 5292538e22c..33811ae202c 100644 Binary files a/forge-gui-ios/libs/gdx-backend-robovm-sources.jar and b/forge-gui-ios/libs/gdx-backend-robovm-sources.jar differ diff --git a/forge-gui-ios/libs/gdx-backend-robovm.jar b/forge-gui-ios/libs/gdx-backend-robovm.jar index f0c3576d5e5..ac7367acc3f 100644 Binary files a/forge-gui-ios/libs/gdx-backend-robovm.jar and b/forge-gui-ios/libs/gdx-backend-robovm.jar differ diff --git a/forge-gui-ios/libs/gdx-sources.jar b/forge-gui-ios/libs/gdx-sources.jar index 11bed47689d..5caca4c850c 100644 Binary files a/forge-gui-ios/libs/gdx-sources.jar and b/forge-gui-ios/libs/gdx-sources.jar differ diff --git a/forge-gui-ios/libs/gdx.jar b/forge-gui-ios/libs/gdx.jar index 50d65286c35..a8592dd5847 100644 Binary files a/forge-gui-ios/libs/gdx.jar and b/forge-gui-ios/libs/gdx.jar differ diff --git a/forge-gui-mobile-dev/libs/gdx-backend-lwjgl-natives.jar b/forge-gui-mobile-dev/libs/gdx-backend-lwjgl-natives.jar index c9dc62392d6..ba2c56714ff 100644 Binary files a/forge-gui-mobile-dev/libs/gdx-backend-lwjgl-natives.jar and b/forge-gui-mobile-dev/libs/gdx-backend-lwjgl-natives.jar differ diff --git a/forge-gui-mobile-dev/libs/gdx-backend-lwjgl-sources.jar b/forge-gui-mobile-dev/libs/gdx-backend-lwjgl-sources.jar index 96604cce9ff..5cc10c0da3d 100644 Binary files a/forge-gui-mobile-dev/libs/gdx-backend-lwjgl-sources.jar and b/forge-gui-mobile-dev/libs/gdx-backend-lwjgl-sources.jar differ diff --git a/forge-gui-mobile-dev/libs/gdx-backend-lwjgl.jar b/forge-gui-mobile-dev/libs/gdx-backend-lwjgl.jar index d893c882a8d..badb484501d 100644 Binary files a/forge-gui-mobile-dev/libs/gdx-backend-lwjgl.jar and b/forge-gui-mobile-dev/libs/gdx-backend-lwjgl.jar differ diff --git a/forge-gui-mobile-dev/libs/gdx-box2d-platform-natives.jar b/forge-gui-mobile-dev/libs/gdx-box2d-platform-natives.jar index c2f4f26f422..ed0621fd9e4 100644 Binary files a/forge-gui-mobile-dev/libs/gdx-box2d-platform-natives.jar and b/forge-gui-mobile-dev/libs/gdx-box2d-platform-natives.jar differ diff --git a/forge-gui-mobile-dev/libs/gdx-freetype-natives.jar b/forge-gui-mobile-dev/libs/gdx-freetype-natives.jar index 8e1f595b0b3..0186c337dc6 100644 Binary files a/forge-gui-mobile-dev/libs/gdx-freetype-natives.jar and b/forge-gui-mobile-dev/libs/gdx-freetype-natives.jar differ diff --git a/forge-gui-mobile-dev/libs/gdx-natives.jar b/forge-gui-mobile-dev/libs/gdx-natives.jar index 15c0b61ffe5..d290ea08431 100644 Binary files a/forge-gui-mobile-dev/libs/gdx-natives.jar and b/forge-gui-mobile-dev/libs/gdx-natives.jar differ diff --git a/forge-gui-mobile-dev/pom.xml b/forge-gui-mobile-dev/pom.xml index 168ecba1dc8..8d5f2687992 100644 --- a/forge-gui-mobile-dev/pom.xml +++ b/forge-gui-mobile-dev/pom.xml @@ -225,7 +225,7 @@ com.badlogicgames.gdx-controllers gdx-controllers-desktop - 2.2.3 + 2.2.4 com.badlogicgames.gdx diff --git a/forge-gui-mobile/libs/gdx-freetype.jar b/forge-gui-mobile/libs/gdx-freetype.jar index daf2f4f1d70..eceb1b32fb7 100644 Binary files a/forge-gui-mobile/libs/gdx-freetype.jar and b/forge-gui-mobile/libs/gdx-freetype.jar differ diff --git a/forge-gui-mobile/libs/gdx-natives.jar b/forge-gui-mobile/libs/gdx-natives.jar index 15c0b61ffe5..d290ea08431 100644 Binary files a/forge-gui-mobile/libs/gdx-natives.jar and b/forge-gui-mobile/libs/gdx-natives.jar differ diff --git a/forge-gui-mobile/libs/gdx-sources.jar b/forge-gui-mobile/libs/gdx-sources.jar index 11bed47689d..5caca4c850c 100644 Binary files a/forge-gui-mobile/libs/gdx-sources.jar and b/forge-gui-mobile/libs/gdx-sources.jar differ diff --git a/forge-gui-mobile/libs/gdx.jar b/forge-gui-mobile/libs/gdx.jar index 50d65286c35..a8592dd5847 100644 Binary files a/forge-gui-mobile/libs/gdx.jar and b/forge-gui-mobile/libs/gdx.jar differ diff --git a/forge-gui-mobile/pom.xml b/forge-gui-mobile/pom.xml index d578aab4403..a9ea7c2fdde 100644 --- a/forge-gui-mobile/pom.xml +++ b/forge-gui-mobile/pom.xml @@ -64,7 +64,7 @@ com.badlogicgames.gdx-controllers gdx-controllers-core - 2.2.3 + 2.2.4 com.badlogicgames.gdx