File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
recipes/android/src/android Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,18 @@ def get_dpi():
170
170
cdef extern void android_show_keyboard(int )
171
171
cdef extern void android_hide_keyboard()
172
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
+
173
185
# Flags for input_type, for requesting a particular type of keyboard
174
186
# android FLAGS
175
187
TYPE_CLASS_DATETIME = 4
You can’t perform that action at this time.
0 commit comments