Skip to content

Commit fd2b8e4

Browse files
committed
Merge pull request kivy#347 from denys-duchier/fix-get_keyboard_height
make get_keyboard_height more dynamic
2 parents d77133e + 32f1aea commit fd2b8e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

recipes/android/src/android/_android.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,10 @@ rctx = autoclass('android.graphics.Rect')()
183183
mActivity = python_act.mActivity
184184
if mActivity:
185185
decor_view = mActivity.getWindow().getDecorView()
186-
height = mActivity.getWindowManager().getDefaultDisplay().getHeight()
186+
default_display = mActivity.getWindowManager().getDefaultDisplay()
187187
# get keyboard height
188188
def get_keyboard_height():
189+
height = default_display.getHeight()
189190
decor_view.getWindowVisibleDisplayFrame(rctx)
190191
return height - rctx.bottom
191192
else:

0 commit comments

Comments
 (0)