Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.6
-
None
Description
I'm writing an Android application (at the time being it's still very simple, and you can find its code here) with QML. Because of QTBUG-41170, I'm telling android not to resize my window and instead I've set the following attribute on the activity in the manifest file:
android:windowSoftInputMode="adjustPan"
and I'm handling the virtual keyboard size by binding my contents size to the Qt.inputMethod.keyboardRectangle.height (the commit implementing this change is here).
Now, this all works like a charm on a couple of Android 5.1.1 phones with no soft buttons. However, on an Android 9 phone with soft buttons, the bottom part of my window contents is always partially hidden by the OSK, when it's open. In some cases (which follow a pseudo-random behaviour, but seem to depend on whether the OSK was opened by tapping on the beginning of a word, or in the middle of it), the content stays hidden even after the OSK gets closed (this time, they hide behind the soft buttons).
I manager to workaround the latter behaviour by binding to
Math.max(Qt.inputMethod.keyboardRectangle.height, 0)
because indeed, in those cases the OSK height is negative. But I haven't figured out a way to workaround the issue when the OSK is opened.
I wonder if this could be related to https://stackoverflow.com/questions/7659652/getwindowvisibledisplayframe-gives-different-values-in-android-2-2-2-3-but-n