浏览代码

Fix SDL 2.0.4 Android code to exclude bogus joystick registration.
Fix Android sample browser glitch when being launched in landscape orientation.
Close #1315.

Yao Wei Tjong 姚伟忠 9 年之前
父节点
当前提交
0486b3bb3e
共有 2 个文件被更改,包括 3 次插入7 次删除
  1. 1 1
      Android/AndroidManifest.xml
  2. 2 6
      Android/src/org/libsdl/app/SDLActivity.java

+ 1 - 1
Android/AndroidManifest.xml

@@ -8,7 +8,7 @@
     <!-- Android 2.3.3 -->
     <uses-sdk
         android:minSdkVersion="10"
-        android:targetSdkVersion="21"/>
+        android:targetSdkVersion="12"/>
 
     <!-- OpenGL ES 2.0 -->
     <uses-feature android:glEsVersion="0x00020000"/>

+ 2 - 6
Android/src/org/libsdl/app/SDLActivity.java

@@ -1524,12 +1524,8 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler {
                 joystick = new SDLJoystick();
                 InputDevice joystickDevice = InputDevice.getDevice(deviceIds[i]);
 
-                if ( 
-                      (joystickDevice.getSources() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0 
-                   ||
-                      (joystickDevice.getSources() & InputDevice.SOURCE_CLASS_BUTTON) != 0 
-                  )
-                {
+                // Urho3D - revert back commit 34a0b0478654e8dfaf111aecc0e4535875c4ec87 as it does more harm than good
+                if( (joystickDevice.getSources() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
                     joystick.device_id = deviceIds[i];
                     joystick.name = joystickDevice.getName();
                     joystick.axes = new ArrayList<InputDevice.MotionRange>();