From 4709a65d9a065d2339e51118be97724ba61c1b92 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 24 Apr 2024 13:27:53 +0200 Subject: Android: remove duplicated code for handling UI mode changes The QtActivityDelegate::handleUiModeChange(int) handler implementation is identical to the one in QtActivityDelegateBase, so no need to override. Change-Id: I9753bc6fa22554c99bd127bdfa85d10007eb551c Reviewed-by: Assam Boudjelthia --- .../qtproject/qt/android/QtActivityDelegate.java | 27 ---------------------- 1 file changed, 27 deletions(-) (limited to 'src/android/jar') 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 f9f1dc3b10..1e1a36be3c 100644 --- a/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java @@ -224,33 +224,6 @@ class QtActivityDelegate extends QtActivityDelegateBase }); } - void handleUiModeChange(int uiMode) - { - // QTBUG-108365 - if (Build.VERSION.SDK_INT >= 30) { - // Since 29 version we are using Theme_DeviceDefault_DayNight - Window window = m_activity.getWindow(); - WindowInsetsController controller = window.getInsetsController(); - if (controller != null) { - // set APPEARANCE_LIGHT_STATUS_BARS if needed - int appearanceLight = Color.luminance(window.getStatusBarColor()) > 0.5 ? - WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS : 0; - controller.setSystemBarsAppearance(appearanceLight, - WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS); - } - } - switch (uiMode) { - case Configuration.UI_MODE_NIGHT_NO: - ExtractStyle.runIfNeeded(m_activity, false); - QtDisplayManager.handleUiDarkModeChanged(0); - break; - case Configuration.UI_MODE_NIGHT_YES: - ExtractStyle.runIfNeeded(m_activity, true); - QtDisplayManager.handleUiDarkModeChanged(1); - break; - } - } - @UsedFromNativeCode public void resetOptionsMenu() { -- cgit v1.2.3