Skip to content

Commit 49e287e

Browse files
committed
Merge pull request #483 from SapienTech/master
Fix keyboard height issue
2 parents 57775a0 + 400ef9b commit 49e287e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pythonforandroid/recipes/android/src/android/_android.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,14 @@ if mActivity:
187187
@java_method('()V')
188188
def onGlobalLayout(self):
189189
rctx = Rect()
190+
# print('rctx_bottom: {0}, top: {1}'.format(rctx.bottom, rctx.top))
190191
mActivity.getWindow().getDecorView().getWindowVisibleDisplayFrame(rctx)
192+
# print('rctx_bottom: {0}, top: {1}'.format(rctx.bottom, rctx.top))
193+
# print('activity height: {0}'.format(mActivity.getWindowManager().getDefaultDisplay().getHeight()))
194+
# NOTE top should always be zero
195+
rctx.top = 0
191196
self.height = mActivity.getWindowManager().getDefaultDisplay().getHeight() - (rctx.bottom - rctx.top)
197+
# print('final height: {0}'.format(self.height))
192198

193199
ll = LayoutListener()
194200
IF BOOTSTRAP == 'sdl2':

0 commit comments

Comments
 (0)