diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/MotionAlertDialog.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/MotionAlertDialog.java index 7bad47066c..31334403a8 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/MotionAlertDialog.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/MotionAlertDialog.java @@ -23,7 +23,6 @@ public final class MotionAlertDialog extends AlertDialog { // The selected input preference private final InputBindingSetting setting; - private final ControllerMappingHelper mControllerMappingHelper; private final ArrayList mPreviousValues = new ArrayList<>(); private int mPrevDeviceId = 0; private boolean mWaitingForEvent = true; @@ -39,7 +38,6 @@ public final class MotionAlertDialog extends AlertDialog super(context); this.setting = setting; - this.mControllerMappingHelper = new ControllerMappingHelper(); } public boolean onKeyEvent(int keyCode, KeyEvent event) @@ -48,7 +46,7 @@ public final class MotionAlertDialog extends AlertDialog switch (event.getAction()) { case KeyEvent.ACTION_DOWN: - if (!mControllerMappingHelper.shouldKeyBeIgnored(event.getDevice(), keyCode)) + if (!ControllerMappingHelper.shouldKeyBeIgnored(event.getDevice(), keyCode)) { saveKeyInput(event); } @@ -103,7 +101,7 @@ public final class MotionAlertDialog extends AlertDialog InputDevice.MotionRange range = motionRanges.get(i); int axis = range.getAxis(); float origValue = event.getAxisValue(axis); - float value = mControllerMappingHelper.scaleAxis(input, axis, origValue); + float value = ControllerMappingHelper.scaleAxis(input, axis, origValue); if (firstEvent) { mPreviousValues.add(value); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ControllerMappingHelper.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ControllerMappingHelper.java index b44fa8cbe4..a579b2d70f 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ControllerMappingHelper.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ControllerMappingHelper.java @@ -8,7 +8,7 @@ import android.view.MotionEvent; public class ControllerMappingHelper { /** Some controllers report extra button presses that can be ignored. */ - public boolean shouldKeyBeIgnored(InputDevice inputDevice, int keyCode) + public static boolean shouldKeyBeIgnored(InputDevice inputDevice, int keyCode) { if (isDualShock4(inputDevice)) { // The two analog triggers generate analog motion events as well as a keycode. @@ -20,7 +20,7 @@ public class ControllerMappingHelper } /** Scale an axis to be zero-centered with a proper range. */ - public float scaleAxis(InputDevice inputDevice, int axis, float value) + public static float scaleAxis(InputDevice inputDevice, int axis, float value) { if (isDualShock4(inputDevice)) { @@ -43,13 +43,13 @@ public class ControllerMappingHelper return value; } - private boolean isDualShock4(InputDevice inputDevice) + private static boolean isDualShock4(InputDevice inputDevice) { // Sony DualShock 4 controller return inputDevice.getVendorId() == 0x54c && inputDevice.getProductId() == 0x9cc; } - private boolean isXboxOneWireless(InputDevice inputDevice) + private static boolean isXboxOneWireless(InputDevice inputDevice) { // Microsoft Xbox One controller return inputDevice.getVendorId() == 0x45e && inputDevice.getProductId() == 0x2e0;