From 44ac50506d0d5009c4c45080996269f9a3af3b6c Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 25 Oct 2024 12:16:54 +0200 Subject: [PATCH] app: [android] ensure a new frame is always scheduled when visible and animating Possible fix to #614. References: https://todo.sr.ht/~eliasnaur/gio/614 Signed-off-by: Elias Naur --- app/os_android.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/os_android.go b/app/os_android.go index 3255d5f9..5b212134 100644 --- a/app/os_android.go +++ b/app/os_android.go @@ -575,10 +575,7 @@ func Java_org_gioui_GioView_onFrameCallback(env *C.JNIEnv, class C.jclass, view if !exist { return } - if w.visible && w.animating { - w.draw(env, false) - callVoidMethod(env, w.view, gioView.postFrameCallback) - } + w.draw(env, false) } //export Java_org_gioui_GioView_onBack @@ -882,6 +879,9 @@ func (w *window) draw(env *C.JNIEnv, sync bool) { }, Sync: sync, }) + if w.animating { + callVoidMethod(env, w.view, gioView.postFrameCallback) + } a11yActive, err := callBooleanMethod(env, w.view, gioView.isA11yActive) if err != nil { panic(err)