diff --git a/src/jni_driver.cpp b/src/jni_driver.cpp index 770e16da7..8f5c352ed 100644 --- a/src/jni_driver.cpp +++ b/src/jni_driver.cpp @@ -63,11 +63,8 @@ AlberFunction(void, LoadRom)(JNIEnv* env, jobject obj, jstring path) { } AlberFunction(void, TouchScreenDown)(JNIEnv* env, jobject obj, jint x, jint y) { hidService->setTouchScreenPress((u16)x, (u16)y); } - AlberFunction(void, TouchScreenUp)(JNIEnv* env, jobject obj) { hidService->releaseTouchScreen(); } - AlberFunction(void, KeyUp)(JNIEnv* env, jobject obj, jint keyCode) { hidService->releaseKey((u32)keyCode); } - AlberFunction(void, KeyDown)(JNIEnv* env, jobject obj, jint keyCode) { hidService->pressKey((u32)keyCode); } AlberFunction(void, SetCirclepadAxis)(JNIEnv* env, jobject obj, jint x, jint y) { diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/GameActivity.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/GameActivity.java index dfba96e5f..2da73b972 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/GameActivity.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/GameActivity.java @@ -17,7 +17,6 @@ import com.panda3ds.pandroid.view.PandaLayoutController; public class GameActivity extends BaseActivity { - @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -31,14 +30,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { } PandaGlSurfaceView pandaSurface = new PandaGlSurfaceView(this, intent.getStringExtra(Constants.ACTIVITY_PARAMETER_PATH)); - setContentView(R.layout.game_activity); ((FrameLayout) findViewById(R.id.panda_gl_frame)) .addView(pandaSurface, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); PandaLayoutController controllerLayout = findViewById(R.id.controller_layout); - controllerLayout.initialize(); ((CheckBox) findViewById(R.id.hide_screen_controller)).setOnCheckedChangeListener((buttonView, isChecked) -> findViewById(R.id.overlay_controller).setVisibility(isChecked ? View.VISIBLE : View.INVISIBLE)); diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/MainActivity.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/MainActivity.java index 368efe0e9..f4fc27bf1 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/MainActivity.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/MainActivity.java @@ -40,7 +40,6 @@ protected void onCreate(Bundle savedInstanceState) { } setContentView(R.layout.activity_main); - findViewById(R.id.load_rom).setOnClickListener(v -> { openFile(); }); } diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/utils/PathUtils.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/utils/PathUtils.java index 0434e53f6..9bfaa0e4a 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/utils/PathUtils.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/utils/PathUtils.java @@ -83,10 +83,7 @@ public static String getDataColumn(Context context, Uri uri, String selection, S } public static boolean isExternalStorageDocument(Uri uri) { return "com.android.externalstorage.documents".equals(uri.getAuthority()); } - public static boolean isDownloadsDocument(Uri uri) { return "com.android.providers.downloads.documents".equals(uri.getAuthority()); } - public static boolean isMediaDocument(Uri uri) { return "com.android.providers.media.documents".equals(uri.getAuthority()); } - public static boolean isGooglePhotosUri(Uri uri) { return "com.google.android.apps.photos.content".equals(uri.getAuthority()); } } \ No newline at end of file diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/PandaLayoutController.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/PandaLayoutController.java index 543ab840d..617b407e9 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/PandaLayoutController.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/PandaLayoutController.java @@ -11,9 +11,7 @@ public class PandaLayoutController extends ControllerLayout { public PandaLayoutController(Context context) { super(context); } - public PandaLayoutController(Context context, AttributeSet attrs) { super(context, attrs); } - public PandaLayoutController(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } public PandaLayoutController(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/ControllerLayout.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/ControllerLayout.java index 4af28497e..32451bc76 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/ControllerLayout.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/ControllerLayout.java @@ -19,9 +19,7 @@ public class ControllerLayout extends RelativeLayout { private final ArrayList controllerNodes = new ArrayList<>(); public ControllerLayout(Context context) { this(context, null); } - public ControllerLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } - public ControllerLayout(Context context, AttributeSet attrs, int defStyleAttr) { this(context, attrs, defStyleAttr, 0); } public ControllerLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { @@ -131,7 +129,7 @@ public void onViewRemoved(View child) { refreshChildren(); } - /*@TODO: Need replace that methods for prevent Android send events directly to children*/ + // TODO: Need to replace these methods to prevent Android sending events directly to children @Override public ArrayList getTouchables() { diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/ControllerNode.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/ControllerNode.java index e6c1dc92b..7d45550a9 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/ControllerNode.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/ControllerNode.java @@ -17,6 +17,5 @@ default Vector2 getPosition() { default boolean isVisible() { return ((View) this).isShown(); } @NonNull Vector2 getSize(); - void onTouch(TouchEvent event); } diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/TouchEvent.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/TouchEvent.java index 8c940414d..6b82d2019 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/TouchEvent.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/TouchEvent.java @@ -5,9 +5,7 @@ public class TouchEvent { private final float x, y; public float getX() { return x; } - public float getY() { return y; } - public TouchType getAction() { return action; } public TouchEvent(float x, float y, TouchType action) { diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/nodes/BasicControllerNode.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/nodes/BasicControllerNode.java index 224be9a41..d196c7ecd 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/nodes/BasicControllerNode.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/nodes/BasicControllerNode.java @@ -9,8 +9,6 @@ public abstract class BasicControllerNode extends AppCompatTextView implements ControllerNode { public BasicControllerNode(@NonNull Context context) { super(context); } - public BasicControllerNode(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); } - public BasicControllerNode(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } } diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/nodes/Joystick.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/nodes/Joystick.java index b63e9d665..03013dd8b 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/nodes/Joystick.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/view/controller/nodes/Joystick.java @@ -20,13 +20,11 @@ public class Joystick extends BasicControllerNode implements ControllerNode { private int width = 0; private int height = 0; - private JoystickListener joystickListener; public Joystick(Context context) { this(context, null); } - public Joystick(Context context, AttributeSet attrs) { this(context, attrs, 0); } - + public Joystick(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); @@ -99,7 +97,6 @@ public void onTouch(TouchEvent event) { y = Math.max(0, Math.min(middle * 2, y)); axisX = ((x - middle) / middle); - axisY = ((y - middle) / middle); if (event.getAction() == TouchType.ACTION_UP) {