[Scummvm-git-logs] scummvm master -> f6d1ab66b7a045e144a720824caddfcff9dccb49
antoniou79
a.antoniou79 at gmail.com
Sat Sep 26 19:16:49 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f6d1ab66b7 ANDROID: Add comments and code to reinforce hiding of system cursor
Commit: f6d1ab66b7a045e144a720824caddfcff9dccb49
https://github.com/scummvm/scummvm/commit/f6d1ab66b7a045e144a720824caddfcff9dccb49
Author: antoniou (a.antoniou79 at gmail.com)
Date: 2020-09-26T22:03:20+03:00
Commit Message:
ANDROID: Add comments and code to reinforce hiding of system cursor
For the case when an external mouse is connected to the device
The code still only fixes the issue for devices runnng Android 7.0 or newer
Changed paths:
backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
diff --git a/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java b/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
index e52663fe78..488cc6d415 100644
--- a/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
+++ b/backends/platform/android/org/scummvm/scummvm/EditableSurfaceView.java
@@ -3,24 +3,32 @@ package org.scummvm.scummvm;
import android.content.Context;
import android.text.InputType;
import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.PointerIcon;
import android.view.SurfaceView;
import android.view.inputmethod.BaseInputConnection;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
+import android.annotation.TargetApi;
public class EditableSurfaceView extends SurfaceView {
+ Context _context;
public EditableSurfaceView(Context context) {
+
super(context);
+ _context = context;
}
public EditableSurfaceView(Context context, AttributeSet attrs) {
super(context, attrs);
+ _context = context;
}
public EditableSurfaceView(Context context, AttributeSet attrs,
int defStyle) {
super(context, attrs, defStyle);
+ _context = context;
}
@Override
@@ -58,4 +66,18 @@ public class EditableSurfaceView extends SurfaceView {
return new MyInputConnection();
}
+
+ // This re-inforces the code for hiding the system mouse.
+ // We already had code for this in ScummVMActivity (see showMouseCursor())
+ // so this might be redundant
+ //
+ // It applies on devices running Android 7 and above
+ // https://stackoverflow.com/a/55482761
+ // https://developer.android.com/reference/android/view/PointerIcon.html
+ //
+ @TargetApi(24)
+ @Override
+ public PointerIcon onResolvePointerIcon(MotionEvent me, int pointerIndex) {
+ return PointerIcon.getSystemIcon(_context, PointerIcon.TYPE_NULL);
+ }
}
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index a7ce50bd56..f3413b0475 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -484,8 +484,10 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
private void showMouseCursor(boolean show) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+ // Android N (Nougat) is Android 7.0
SurfaceView main_surface = findViewById(R.id.main_surface);
int type = show ? PointerIcon.TYPE_DEFAULT : PointerIcon.TYPE_NULL;
+ // https://stackoverflow.com/a/55482761
main_surface.setPointerIcon(PointerIcon.getSystemIcon(this, type));
} else {
/* Currently hiding the system mouse cursor is only
More information about the Scummvm-git-logs
mailing list