Android: keep compatibility with older JDK
authorSylvain Becker
Wed, 28 Oct 2020 14:03:05 +0100
changeset 142081840e9ddf407
parent 14207 7225f02f0055
child 14209 467540bb2114
Android: keep compatibility with older JDK
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java
     1.1 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Tue Oct 27 21:14:49 2020 +0100
     1.2 +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Wed Oct 28 14:03:05 2020 +0100
     1.3 @@ -198,7 +198,7 @@
     1.4          mTextEdit = null;
     1.5          mLayout = null;
     1.6          mClipboardHandler = null;
     1.7 -        mCursors = new Hashtable<>();
     1.8 +        mCursors = new Hashtable<Integer, PointerIcon>();
     1.9          mLastCursorID = 0;
    1.10          mSDLThread = null;
    1.11          mIsResumedCalled = false;
    1.12 @@ -1369,7 +1369,7 @@
    1.13          int[] buttonIds = args.getIntArray("buttonIds");
    1.14          String[] buttonTexts = args.getStringArray("buttonTexts");
    1.15  
    1.16 -        final SparseArray<Button> mapping = new SparseArray<>();
    1.17 +        final SparseArray<Button> mapping = new SparseArray<Button>();
    1.18  
    1.19          LinearLayout buttons = new LinearLayout(this);
    1.20          buttons.setOrientation(LinearLayout.HORIZONTAL);
     2.1 --- a/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java	Tue Oct 27 21:14:49 2020 +0100
     2.2 +++ b/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java	Wed Oct 28 14:03:05 2020 +0100
     2.3 @@ -176,7 +176,7 @@
     2.4  
     2.5      public SDLJoystickHandler_API16() {
     2.6  
     2.7 -        mJoysticks = new ArrayList<>();
     2.8 +        mJoysticks = new ArrayList<SDLJoystick>();
     2.9      }
    2.10  
    2.11      @Override
    2.12 @@ -192,8 +192,8 @@
    2.13                      joystick.device_id = device_id;
    2.14                      joystick.name = joystickDevice.getName();
    2.15                      joystick.desc = getJoystickDescriptor(joystickDevice);
    2.16 -                    joystick.axes = new ArrayList<>();
    2.17 -                    joystick.hats = new ArrayList<>();
    2.18 +                    joystick.axes = new ArrayList<InputDevice.MotionRange>();
    2.19 +                    joystick.hats = new ArrayList<InputDevice.MotionRange>();
    2.20  
    2.21                      List<InputDevice.MotionRange> ranges = joystickDevice.getMotionRanges();
    2.22                      Collections.sort(ranges, new RangeComparator());
    2.23 @@ -225,7 +225,7 @@
    2.24              }
    2.25              if (i == deviceIds.length) {
    2.26                  if (removedDevices == null) {
    2.27 -                    removedDevices = new ArrayList<>();
    2.28 +                    removedDevices = new ArrayList<Integer>();
    2.29                  }
    2.30                  removedDevices.add(device_id);
    2.31              }
    2.32 @@ -447,7 +447,7 @@
    2.33      private final ArrayList<SDLHaptic> mHaptics;
    2.34  
    2.35      public SDLHapticHandler() {
    2.36 -        mHaptics = new ArrayList<>();
    2.37 +        mHaptics = new ArrayList<SDLHaptic>();
    2.38      }
    2.39  
    2.40      public void run(int device_id, float intensity, int length) {
    2.41 @@ -521,7 +521,7 @@
    2.42              if (device_id != deviceId_VIBRATOR_SERVICE || !hasVibratorService) {
    2.43                  if (i == deviceIds.length) {
    2.44                      if (removedDevices == null) {
    2.45 -                        removedDevices = new ArrayList<>();
    2.46 +                        removedDevices = new ArrayList<Integer>();
    2.47                      }
    2.48                      removedDevices.add(device_id);
    2.49                  }