Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions recipes/android/src/android/_android.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,16 @@ version_codes = autoclass('android.os.Build$VERSION_CODES')
python_act = autoclass('org.renpy.android.PythonActivity')
rctx = autoclass('android.graphics.Rect')()
mActivity = python_act.mActivity
decor_view = mActivity.getWindow().getDecorView()
height = mActivity.getWindowManager().getDefaultDisplay().getHeight()
# get keyboard height
def get_keyboard_height():
decor_view.getWindowVisibleDisplayFrame(rctx)
return height - rctx.bottom

if mActivity:
decor_view = mActivity.getWindow().getDecorView()
height = mActivity.getWindowManager().getDefaultDisplay().getHeight()
# get keyboard height
def get_keyboard_height():
decor_view.getWindowVisibleDisplayFrame(rctx)
return height - rctx.bottom
else:
def get_keyboard_height():
return 0

# Flags for input_type, for requesting a particular type of keyboard
#android FLAGS
Expand Down