diff options
author | Fredia Huya-Kouadio <fhuya@fb.com> | 2022-10-05 13:07:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 13:07:34 -0700 |
commit | ea9bb98f26be8212245f6ff796617901a8b9f3f6 (patch) | |
tree | 494aa473e2fd9489011299c59ad75d8435f1012a /platform/android/java/lib | |
parent | 38113acf0d368eff1069c5daca57b5f5c4d9878e (diff) | |
parent | ffe0e3970fad624e93a560285ecb0addcd89215a (diff) |
Merge pull request #66946 from m4gr3d/cursor_shape_logic_cleanup_main
Cleanup of the Android cursor shape logic
Diffstat (limited to 'platform/android/java/lib')
-rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/GodotGLRenderView.java | 10 | ||||
-rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/GodotVulkanRenderView.java | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotGLRenderView.java b/platform/android/java/lib/src/org/godotengine/godot/GodotGLRenderView.java index 513021f1d1..3dfc37f6b0 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotGLRenderView.java +++ b/platform/android/java/lib/src/org/godotengine/godot/GodotGLRenderView.java @@ -74,7 +74,6 @@ public class GodotGLRenderView extends GLSurfaceView implements GodotRenderView private final Godot godot; private final GodotInputHandler inputHandler; private final GodotRenderer godotRenderer; - private PointerIcon pointerIcon; public GodotGLRenderView(Context context, Godot godot, XRMode xrMode, boolean p_use_debug_opengl) { super(context); @@ -84,7 +83,7 @@ public class GodotGLRenderView extends GLSurfaceView implements GodotRenderView this.inputHandler = new GodotInputHandler(this); this.godotRenderer = new GodotRenderer(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - pointerIcon = PointerIcon.getSystemIcon(getContext(), PointerIcon.TYPE_DEFAULT); + setPointerIcon(PointerIcon.getSystemIcon(getContext(), PointerIcon.TYPE_DEFAULT)); } init(xrMode, false); } @@ -175,13 +174,16 @@ public class GodotGLRenderView extends GLSurfaceView implements GodotRenderView @Keep public void setPointerIcon(int pointerType) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - pointerIcon = PointerIcon.getSystemIcon(getContext(), pointerType); + setPointerIcon(PointerIcon.getSystemIcon(getContext(), pointerType)); } } @Override public PointerIcon onResolvePointerIcon(MotionEvent me, int pointerIndex) { - return pointerIcon; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + return getPointerIcon(); + } + return super.onResolvePointerIcon(me, pointerIndex); } private void init(XRMode xrMode, boolean translucent) { diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotVulkanRenderView.java b/platform/android/java/lib/src/org/godotengine/godot/GodotVulkanRenderView.java index fa6c3280b9..0becf00d93 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotVulkanRenderView.java +++ b/platform/android/java/lib/src/org/godotengine/godot/GodotVulkanRenderView.java @@ -48,7 +48,6 @@ public class GodotVulkanRenderView extends VkSurfaceView implements GodotRenderV private final Godot godot; private final GodotInputHandler mInputHandler; private final VkRenderer mRenderer; - private PointerIcon pointerIcon; public GodotVulkanRenderView(Context context, Godot godot) { super(context); @@ -57,7 +56,7 @@ public class GodotVulkanRenderView extends VkSurfaceView implements GodotRenderV mInputHandler = new GodotInputHandler(this); mRenderer = new VkRenderer(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - pointerIcon = PointerIcon.getSystemIcon(getContext(), PointerIcon.TYPE_DEFAULT); + setPointerIcon(PointerIcon.getSystemIcon(getContext(), PointerIcon.TYPE_DEFAULT)); } setFocusableInTouchMode(true); startRenderer(mRenderer); @@ -149,13 +148,16 @@ public class GodotVulkanRenderView extends VkSurfaceView implements GodotRenderV @Keep public void setPointerIcon(int pointerType) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - pointerIcon = PointerIcon.getSystemIcon(getContext(), pointerType); + setPointerIcon(PointerIcon.getSystemIcon(getContext(), pointerType)); } } @Override public PointerIcon onResolvePointerIcon(MotionEvent me, int pointerIndex) { - return pointerIcon; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + return getPointerIcon(); + } + return super.onResolvePointerIcon(me, pointerIndex); } @Override |