We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
get_keyboard_height
1 parent c1cb694 commit b1ba8dcCopy full SHA for b1ba8dc
recipes/android/src/android/_android.pyx
@@ -170,6 +170,18 @@ def get_dpi():
170
cdef extern void android_show_keyboard(int)
171
cdef extern void android_hide_keyboard()
172
173
+# get keyboard height
174
+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
+ return height - rctx.bottom
183
+
184
185
# Flags for input_type, for requesting a particular type of keyboard
186
#android FLAGS
187
TYPE_CLASS_DATETIME = 4
0 commit comments