File tree 1 file changed +10
-7
lines changed
recipes/android/src/android
1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -181,13 +181,16 @@ version_codes = autoclass('android.os.Build$VERSION_CODES')
181
181
python_act = autoclass(' org.renpy.android.PythonActivity' )
182
182
rctx = autoclass(' android.graphics.Rect' )()
183
183
mActivity = python_act.mActivity
184
- decor_view = mActivity.getWindow().getDecorView()
185
- height = mActivity.getWindowManager().getDefaultDisplay().getHeight()
186
- # get keyboard height
187
- def get_keyboard_height ():
188
- decor_view.getWindowVisibleDisplayFrame(rctx)
189
- return height - rctx.bottom
190
-
184
+ if mActivity:
185
+ decor_view = mActivity.getWindow().getDecorView()
186
+ height = mActivity.getWindowManager().getDefaultDisplay().getHeight()
187
+ # get keyboard height
188
+ def get_keyboard_height ():
189
+ decor_view.getWindowVisibleDisplayFrame(rctx)
190
+ return height - rctx.bottom
191
+ else :
192
+ def get_keyboard_height ():
193
+ return 0
191
194
192
195
# Flags for input_type, for requesting a particular type of keyboard
193
196
# android FLAGS
You can’t perform that action at this time.
0 commit comments