mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-22 21:09:52 +00:00
F-droid lite version - create stubs for Moga Controller
This commit is contained in:
parent
4c3f168211
commit
8694c33119
@ -144,6 +144,12 @@ android {
|
||||
afterEvaluate {
|
||||
android.sourceSets.main.assets.getSrcDirs().each { println it }
|
||||
}
|
||||
dependencies {
|
||||
implementation files('libs/com.bda.controller.jar')
|
||||
|
||||
// F-Droid lite version can be created with : ./gradlew assembleOptimized -Pf_droid
|
||||
if (project.hasProperty("f_droid")) {
|
||||
project.android.sourceSets.main.java.srcDirs += 'libs/MogaStubs'
|
||||
} else {
|
||||
project.dependencies {
|
||||
implementation files('libs/com.bda.controller.jar')
|
||||
}
|
||||
}
|
||||
|
39
android/libs/MogaStubs/com/bda/controller/Controller.java
Normal file
39
android/libs/MogaStubs/com/bda/controller/Controller.java
Normal file
@ -0,0 +1,39 @@
|
||||
package com.bda.controller;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Handler;
|
||||
import android.view.SurfaceView;
|
||||
|
||||
public class Controller {
|
||||
public static final int ACTION_VERSION_MOGA = 0;
|
||||
public static final int STATE_CURRENT_PRODUCT_VERSION = 1;
|
||||
|
||||
static Controller sInstance;
|
||||
|
||||
private Controller() {}
|
||||
|
||||
public static Controller getInstance(Activity activity) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new Controller();
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
public int getState(int val) {
|
||||
return 0;
|
||||
}
|
||||
public int setListener(SurfaceView view, Handler handler) {
|
||||
return 0;
|
||||
}
|
||||
public int init() {
|
||||
return 0;
|
||||
}
|
||||
public int onPause() {
|
||||
return 0;
|
||||
}
|
||||
public int onResume() {
|
||||
return 0;
|
||||
}
|
||||
public int exit() {
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.bda.controller;
|
||||
|
||||
public interface ControllerListener {
|
||||
public abstract void onKeyEvent(KeyEvent event);
|
||||
|
||||
public abstract void onMotionEvent(MotionEvent event);
|
||||
|
||||
public abstract void onStateEvent(StateEvent state);
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.bda.controller;
|
||||
|
||||
public class IControllerService {
|
||||
}
|
20
android/libs/MogaStubs/com/bda/controller/KeyEvent.java
Normal file
20
android/libs/MogaStubs/com/bda/controller/KeyEvent.java
Normal file
@ -0,0 +1,20 @@
|
||||
package com.bda.controller;
|
||||
|
||||
public class KeyEvent {
|
||||
public static final int ACTION_DOWN = 0;
|
||||
public static final int ACTION_UP = 1;
|
||||
public static final int KEYCODE_DPAD_UP = 2;
|
||||
public static final int KEYCODE_DPAD_DOWN = 3;
|
||||
public static final int KEYCODE_DPAD_LEFT = 4;
|
||||
public static final int KEYCODE_DPAD_RIGHT = 5;
|
||||
|
||||
public int getAction() {
|
||||
return 0;
|
||||
}
|
||||
public int getState(int val) {
|
||||
return 0;
|
||||
}
|
||||
public int getKeyCode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
14
android/libs/MogaStubs/com/bda/controller/MotionEvent.java
Normal file
14
android/libs/MogaStubs/com/bda/controller/MotionEvent.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.bda.controller;
|
||||
|
||||
public class MotionEvent {
|
||||
public static final int AXIS_X = 0;
|
||||
public static final int AXIS_Y = 1;
|
||||
public static final int AXIS_Z = 2;
|
||||
public static final int AXIS_RZ = 3;
|
||||
public static final int AXIS_LTRIGGER = 4;
|
||||
public static final int AXIS_RTRIGGER = 5;
|
||||
|
||||
public int getAxisValue(int val) {
|
||||
return 0;
|
||||
}
|
||||
}
|
19
android/libs/MogaStubs/com/bda/controller/StateEvent.java
Normal file
19
android/libs/MogaStubs/com/bda/controller/StateEvent.java
Normal file
@ -0,0 +1,19 @@
|
||||
package com.bda.controller;
|
||||
|
||||
public class StateEvent {
|
||||
public static final int STATE_POWER_LOW = 0;
|
||||
public static final int STATE_CONNECTION = 1;
|
||||
|
||||
public static final int ACTION_FALSE = 0;
|
||||
public static final int ACTION_TRUE = 1;
|
||||
public static final int ACTION_DISCONNECTED = 2;
|
||||
public static final int ACTION_CONNECTING = 3;
|
||||
public static final int ACTION_CONNECTED = 4;
|
||||
|
||||
public int getAction() {
|
||||
return 0;
|
||||
}
|
||||
public int getState() {
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -18,7 +18,11 @@ import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import com.bda.controller.*;
|
||||
|
||||
import com.bda.controller.Controller;
|
||||
import com.bda.controller.ControllerListener;
|
||||
import com.bda.controller.KeyEvent;
|
||||
import com.bda.controller.StateEvent;
|
||||
|
||||
public class NativeGLView extends GLSurfaceView implements SensorEventListener, ControllerListener {
|
||||
private static String TAG = "NativeGLView";
|
||||
|
@ -16,7 +16,11 @@ import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SurfaceView;
|
||||
import com.bda.controller.*;
|
||||
|
||||
import com.bda.controller.Controller;
|
||||
import com.bda.controller.ControllerListener;
|
||||
import com.bda.controller.KeyEvent;
|
||||
import com.bda.controller.StateEvent;
|
||||
|
||||
public class NativeSurfaceView extends SurfaceView implements SensorEventListener, ControllerListener {
|
||||
private static String TAG = "NativeSurfaceView";
|
||||
|
Loading…
Reference in New Issue
Block a user