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 <assam.boudjelthia@qt.io>
bb10
Volker Hilsheimer 2024-04-24 13:27:53 +02:00
parent ed191b6afa
commit 4709a65d9a
1 changed files with 0 additions and 27 deletions

View File

@ -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()
{