diff options
author | Andy Shaw <andy.shaw@qt.io> | 2021-10-04 16:23:18 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2021-10-14 17:20:58 +0200 |
commit | d0d29a944a5836bedbac9e57ffc937c5c3842899 (patch) | |
tree | 7592482dd061152f9672b03ece331200e98fc8b4 /src/android | |
parent | 5c436365f579f820344566101e746e244672995a (diff) |
Android: Hide the keyboard when the height is less than 0
When swiping on a device to do the back gesture then there is no back
key pressed sent so we still need to catch when the keyboard is hidden.
So we can listen for the geometry change and if the height is less than
0 then it is safe to say it is hidden so we update the internal setting
on this.
Fixes: QTBUG-96560
Pick-to: 6.2 5.15
Change-Id: Iec0560935ef914d2cebcb7641a72ab4f71877d23
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java index 9c36090c92..9039f9c4f9 100644 --- a/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java @@ -848,6 +848,10 @@ public class QtActivityDelegate DisplayMetrics metrics = new DisplayMetrics(); m_activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); final int kbHeight = metrics.heightPixels - r.bottom; + if (kbHeight < 0) { + setKeyboardVisibility(false, System.nanoTime()); + return true; + } final int[] location = new int[2]; m_layout.getLocationOnScreen(location); QtNative.keyboardGeometryChanged(location[0], r.bottom - location[1], |