fix keyboard insets attempting to use new apis

This commit is contained in:
Chloe committed 2026-10-17 17:54:11 -05:00
1 parent 626f8d00d1
commit 6c57f3f261
1 file changed
+4
@@ -97,6 +97,10 @@ class Cocos2dxGLSurfaceView(context: Context) : GLSurfaceView(context) {
@RequiresApi(Build.VERSION_CODES.R) @RequiresApi(Build.VERSION_CODES.R)
fun onKeyboardInsets(windowInsets: WindowInsets) { fun onKeyboardInsets(windowInsets: WindowInsets) {
if (!cocos2dxGLSurfaceView.sendNewCocosEvents) {
return
}
val visible = windowInsets.isVisible(WindowInsets.Type.ime()) val visible = windowInsets.isVisible(WindowInsets.Type.ime())
val offsetHeight = if (visible) windowInsets.getInsets(WindowInsets.Type.ime()).bottom else 0 val offsetHeight = if (visible) windowInsets.getInsets(WindowInsets.Type.ime()).bottom else 0