Android: suppress deprecation warnings for pre-Android 30 system ui APIs
Those APIs are already guarded with an API check, so we can silent javac warnings about them. Change-Id: I98dc12520e25c513ed97d750446f188dcf084362 Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
This commit is contained in:
parent
d25064b04d
commit
740d995a89
@ -125,6 +125,27 @@ class QtDisplayManager {
|
|||||||
displayManager.unregisterDisplayListener(m_displayListener);
|
displayManager.unregisterDisplayListener(m_displayListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
void setSystemUiVisibilityPreAndroidR(View decorView)
|
||||||
|
{
|
||||||
|
int systemUiVisibility;
|
||||||
|
|
||||||
|
if (m_isFullScreen || m_expandedToCutout) {
|
||||||
|
systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
|
||||||
|
if (m_isFullScreen) {
|
||||||
|
systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
|
| View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
decorView.setSystemUiVisibility(systemUiVisibility);
|
||||||
|
}
|
||||||
|
|
||||||
void setSystemUiVisibility(boolean isFullScreen, boolean expandedToCutout)
|
void setSystemUiVisibility(boolean isFullScreen, boolean expandedToCutout)
|
||||||
{
|
{
|
||||||
if (m_isFullScreen == isFullScreen && m_expandedToCutout == expandedToCutout)
|
if (m_isFullScreen == isFullScreen && m_expandedToCutout == expandedToCutout)
|
||||||
@ -132,6 +153,7 @@ class QtDisplayManager {
|
|||||||
|
|
||||||
m_isFullScreen = isFullScreen;
|
m_isFullScreen = isFullScreen;
|
||||||
m_expandedToCutout = expandedToCutout;
|
m_expandedToCutout = expandedToCutout;
|
||||||
|
|
||||||
Window window = m_activity.getWindow();
|
Window window = m_activity.getWindow();
|
||||||
View decorView = window.getDecorView();
|
View decorView = window.getDecorView();
|
||||||
|
|
||||||
@ -160,25 +182,8 @@ class QtDisplayManager {
|
|||||||
}
|
}
|
||||||
insetsControl.setSystemBarsBehavior(sysBarsBehavior);
|
insetsControl.setSystemBarsBehavior(sysBarsBehavior);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
int systemUiVisibility;
|
setSystemUiVisibilityPreAndroidR(decorView);
|
||||||
|
|
||||||
if (m_isFullScreen || m_expandedToCutout) {
|
|
||||||
systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
||||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
|
|
||||||
if (m_isFullScreen) {
|
|
||||||
systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
||||||
| View.SYSTEM_UI_FLAG_FULLSCREEN
|
|
||||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
|
||||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
decorView.setSystemUiVisibility(systemUiVisibility);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isFullScreen) {
|
if (!isFullScreen) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user