File tree 1 file changed +8
-7
lines changed
recipes/android/src/android
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -170,15 +170,16 @@ def get_dpi():
170
170
cdef extern void android_show_keyboard(int )
171
171
cdef extern void android_hide_keyboard()
172
172
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()
173
180
# get keyboard height
174
181
def 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)
182
183
return height - rctx.bottom
183
184
184
185
You can’t perform that action at this time.
0 commit comments