Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11545 from Florin9doi/MOGA_STUB
F-droid lite version - create stubs for Moga Controller
- Loading branch information
Showing
9 changed files
with
123 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
android/libs/MogaStubs/com/bda/controller/ControllerListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
4 changes: 4 additions & 0 deletions
4
android/libs/MogaStubs/com/bda/controller/IControllerService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.bda.controller; | ||
|
||
public class IControllerService { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 14 additions & 0 deletions
14
android/libs/MogaStubs/com/bda/controller/MotionEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters