File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
recipes/android/src/android Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -170,15 +170,16 @@ def get_dpi():
170170cdef extern void android_show_keyboard(int )
171171cdef extern void android_hide_keyboard()
172172
173+
174+ from jnius import autoclass
175+ python_act = autoclass(' org.renpy.android.PythonActivity' )
176+ rctx = autoclass(' android.graphics.Rect' )()
177+ mActivity = python_act.mActivity
178+ decor_view = mActivity.getWindow().getDecorView()
179+ height = mActivity.getWindowManager().getDefaultDisplay().getHeight()
173180# get keyboard height
174181def get_keyboard_height ():
175- from jnius import autoclass
176- python_act = autoclass(' org.renpy.android.PythonActivity' )
177- rctx = autoclass(' android.graphics.Rect' )()
178- mActivity = python_act.mActivity
179- mActivity.getWindow().getDecorView().\
180- getWindowVisibleDisplayFrame(rctx)
181- height = mActivity.getWindowManager().getDefaultDisplay().getHeight()
182+ decor_view.getWindowVisibleDisplayFrame(rctx)
182183 return height - rctx.bottom
183184
184185
You can’t perform that action at this time.
0 commit comments