Android: fix Quick for Android density

Amends 060a65f6c8c6b2e5528cb3cc91e7bba969d52a4f, which seems to make
Quick for Android apps show content with big sizes, the quickest fix
is to partially revert to the previous behavior while still have the
calls to update density, orientation and refresh rate under one
common method under QtDisplayManager.

Fixes: QTBUG-133754
Change-Id: I9a3791354cc6d425f858a6d1d7075ec8ddae8eb3
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
This commit is contained in:
Assam Boudjelthia 2025-02-17 17:02:12 +02:00
parent 3c4ec4de14
commit f18f50a8be
3 changed files with 3 additions and 1 deletions

View File

@ -142,6 +142,8 @@ class QtActivityDelegate extends QtActivityDelegateBase
handleUiModeChange(m_activity.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK);
m_displayManager.initDisplayProperties();
m_layout.getViewTreeObserver().addOnPreDrawListener(() -> {
if (!m_inputDelegate.isKeyboardVisible())
return true;

View File

@ -76,7 +76,6 @@ abstract class QtActivityDelegateBase
m_membersInitialized = true;
m_topLevelWindows.clear();
m_displayManager.registerDisplayListener();
m_displayManager.initDisplayProperties();
m_inputDelegate.initInputMethodManager(m_activity);
try {

View File

@ -114,6 +114,7 @@ class QtEmbeddedDelegate extends QtActivityDelegateBase
QtNative.runAction(() -> {
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
QtDisplayManager.handleLayoutSizeChanged(metrics.widthPixels, metrics.heightPixels);
m_displayManager.initDisplayProperties();
});
}
}