From 9ba94b1e624a678dfacf828aa3b9747cd5143cd9 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Fri, 3 Jan 2025 17:05:21 +0200 Subject: [PATCH] Android: don't touch system bars colors in fullscreen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In fullscreen mode, don't try to touch the system bars colors neither making them transparent or restoring the default colors as it's irrelevant as the bars are not visible. Task-number: QTBUG-132720 Change-Id: I3b3cc604d8b1241b50555fd964a51e7836c9034c Reviewed-by: Tor Arne Vestbø --- .../qt/android/QtDisplayManager.java | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt/android/QtDisplayManager.java b/src/android/jar/src/org/qtproject/qt/android/QtDisplayManager.java index 6f97f052aae..9c8e74594df 100644 --- a/src/android/jar/src/org/qtproject/qt/android/QtDisplayManager.java +++ b/src/android/jar/src/org/qtproject/qt/android/QtDisplayManager.java @@ -183,22 +183,24 @@ class QtDisplayManager { decorView.setSystemUiVisibility(systemUiVisibility); } - // Handle transparent status and navigation bars - if (m_expandedToCutout) { - window.setStatusBarColor(Color.TRANSPARENT); - window.setNavigationBarColor(Color.TRANSPARENT); - } else { - // Restore theme's system bars colors - Theme theme = m_activity.getTheme(); - TypedValue typedValue = new TypedValue(); + if (!isFullScreen) { + // Handle transparent status and navigation bars + if (m_expandedToCutout) { + window.setStatusBarColor(Color.TRANSPARENT); + window.setNavigationBarColor(Color.TRANSPARENT); + } else { + // Restore theme's system bars colors + Theme theme = m_activity.getTheme(); + TypedValue typedValue = new TypedValue(); - theme.resolveAttribute(android.R.attr.statusBarColor, typedValue, true); - int defaultStatusBarColor = typedValue.data; - window.setStatusBarColor(defaultStatusBarColor); + theme.resolveAttribute(android.R.attr.statusBarColor, typedValue, true); + int defaultStatusBarColor = typedValue.data; + window.setStatusBarColor(defaultStatusBarColor); - theme.resolveAttribute(android.R.attr.navigationBarColor, typedValue, true); - int defaultNavigationBarColor = typedValue.data; - window.setNavigationBarColor(defaultNavigationBarColor); + theme.resolveAttribute(android.R.attr.navigationBarColor, typedValue, true); + int defaultNavigationBarColor = typedValue.data; + window.setNavigationBarColor(defaultNavigationBarColor); + } } }