From a968042f54aaa0155374f8a4140aaa1122f82949 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 14 May 2014 14:38:07 +0200 Subject: Restore fullscreen mode after keyboard is dismissed Showing the onscreen keyboard will also show the navigation soft buttons. We need to tell Android to re-enable immersive mode after the keyboard is hidden. Since we now do this in two places, refactor the logic. Task-number: QTBUG-36916 Change-Id: Ic69c28f41f5e8cf324d81f9bada3cb148dfb5306 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../org/qtproject/qt5/android/QtActivityDelegate.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index b396dfdfa1..554c54d4a0 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -170,6 +170,13 @@ public class QtActivityDelegate m_layout.requestLayout(); } + public void updateFullScreen() + { + if (m_fullScreen) { + m_fullScreen = false; + setFullScreen(true); + } + } // input method hints - must be kept in sync with QTDIR/src/corelib/global/qnamespace.h private final int ImhHiddenText = 0x1; @@ -213,6 +220,10 @@ public class QtActivityDelegate return false; m_keyboardIsVisible = visibility; QtNative.keyboardVisibilityChanged(m_keyboardIsVisible); + + if (visibility == false) + updateFullScreen(); // Hiding the keyboard clears the immersive mode, so we need to set it again. + return true; } public void resetSoftwareKeyboard() @@ -721,12 +732,7 @@ public class QtActivityDelegate QtNative.updateApplicationState(ApplicationActive); QtNative.clearLostActions(); QtNative.updateWindow(); - - if (m_fullScreen) { - // Suspending the app clears the immersive mode, so we need to set it again. - m_fullScreen = false; // Force the setFullScreen() call below to actually do something - setFullScreen(true); - } + updateFullScreen(); // Suspending the app clears the immersive mode, so we need to set it again. } } } -- cgit v1.2.3