mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
app/internal/window: [android] remove redundant context argument
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -124,12 +124,12 @@ public final class GioView extends SurfaceView implements Choreographer.FrameCal
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setCursor(Context ctx, int id) {
|
private void setCursor(int id) {
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PointerIcon pointerIcon = PointerIcon.getSystemIcon(ctx, id);
|
PointerIcon pointerIcon = PointerIcon.getSystemIcon(getContext(), id);
|
||||||
GioView.this.setPointerIcon(pointerIcon);
|
setPointerIcon(pointerIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dispatchMotionEvent(MotionEvent event) {
|
private void dispatchMotionEvent(MotionEvent event) {
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ func Java_org_gioui_GioView_onCreateView(env *C.JNIEnv, class C.jclass, view C.j
|
|||||||
m.showTextInput = getMethodID(env, class, "showTextInput", "()V")
|
m.showTextInput = getMethodID(env, class, "showTextInput", "()V")
|
||||||
m.hideTextInput = getMethodID(env, class, "hideTextInput", "()V")
|
m.hideTextInput = getMethodID(env, class, "hideTextInput", "()V")
|
||||||
m.postFrameCallback = getMethodID(env, class, "postFrameCallback", "()V")
|
m.postFrameCallback = getMethodID(env, class, "postFrameCallback", "()V")
|
||||||
m.setCursor = getMethodID(env, class, "setCursor", "(Landroid/content/Context;I)V")
|
m.setCursor = getMethodID(env, class, "setCursor", "(I)V")
|
||||||
})
|
})
|
||||||
view = C.gio_jni_NewGlobalRef(env, view)
|
view = C.gio_jni_NewGlobalRef(env, view)
|
||||||
w := &window{
|
w := &window{
|
||||||
@@ -679,8 +679,7 @@ func (w *window) SetCursor(name pointer.CursorName) {
|
|||||||
curID = 0 // TYPE_NULL
|
curID = 0 // TYPE_NULL
|
||||||
}
|
}
|
||||||
runOnMain(func(env *C.JNIEnv) {
|
runOnMain(func(env *C.JNIEnv) {
|
||||||
callVoidMethod(env, w.view, gioView.setCursor,
|
callVoidMethod(env, w.view, gioView.setCursor, jvalue(curID))
|
||||||
jvalue(android.appCtx), jvalue(curID))
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user