File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
recipes/android/src/android Expand file tree Collapse file tree 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')
181181python_act = autoclass(' org.renpy.android.PythonActivity' )
182182rctx = autoclass(' android.graphics.Rect' )()
183183mActivity = 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
191194
192195# Flags for input_type, for requesting a particular type of keyboard
193196# android FLAGS
You can’t perform that action at this time.
0 commit comments