diff options
3 files changed, 10 insertions, 13 deletions
diff --git a/packages/SystemUI/res/layout/scene_window_root.xml b/packages/SystemUI/res/layout/scene_window_root.xml index bb8de4c32e76..0dcd15b429c1 100644 --- a/packages/SystemUI/res/layout/scene_window_root.xml +++ b/packages/SystemUI/res/layout/scene_window_root.xml @@ -24,7 +24,7 @@ android:id="@+id/scene_window_root" android:layout_width="match_parent" android:layout_height="match_parent" - android:fitsSystemWindows="false"> + android:fitsSystemWindows="true"> <include layout="@layout/super_notification_shade" android:layout_width="match_parent" diff --git a/packages/SystemUI/src/com/android/systemui/scene/ui/view/WindowRootView.kt b/packages/SystemUI/src/com/android/systemui/scene/ui/view/WindowRootView.kt index 22645c4532f6..ea19020d84d4 100644 --- a/packages/SystemUI/src/com/android/systemui/scene/ui/view/WindowRootView.kt +++ b/packages/SystemUI/src/com/android/systemui/scene/ui/view/WindowRootView.kt @@ -71,7 +71,6 @@ open class WindowRootView( override fun onApplyWindowInsets(windowInsets: WindowInsets): WindowInsets? { val insets = windowInsets.getInsetsIgnoringVisibility(WindowInsets.Type.systemBars()) - val displayCutout = rootWindowInsets.displayCutout if (fitsSystemWindows) { val paddingChanged = insets.top != paddingTop || insets.bottom != paddingBottom @@ -79,23 +78,22 @@ open class WindowRootView( if (paddingChanged) { setPadding(0, 0, 0, 0) } - - val pairInsets: Pair<Int, Int> = - layoutInsetsController.getinsets(windowInsets, displayCutout) - leftInset = pairInsets.first - rightInset = pairInsets.second - applyMargins() } else { val changed = paddingLeft != 0 || paddingRight != 0 || paddingTop != 0 || paddingBottom != 0 if (changed) { setPadding(0, 0, 0, 0) } - - leftInset = 0 - rightInset = 0 } + leftInset = 0 + rightInset = 0 + val displayCutout = rootWindowInsets.displayCutout + val pairInsets: Pair<Int, Int> = + layoutInsetsController.getinsets(windowInsets, displayCutout) + leftInset = pairInsets.first + rightInset = pairInsets.second + applyMargins() return windowInsets } diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowControllerImpl.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowControllerImpl.java index 8f9cef37dac7..f7fed537a167 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowControllerImpl.java @@ -60,7 +60,6 @@ import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; import com.android.systemui.res.R; -import com.android.systemui.scene.shared.flag.SceneContainerFlag; import com.android.systemui.scene.shared.flag.SceneContainerFlags; import com.android.systemui.scene.ui.view.WindowRootViewComponent; import com.android.systemui.settings.UserTracker; @@ -507,7 +506,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW private void applyFitsSystemWindows(NotificationShadeWindowState state) { boolean fitsSystemWindows = !state.isKeyguardShowingAndNotOccluded(); - if (!SceneContainerFlag.isEnabled() && mWindowRootView != null + if (mWindowRootView != null && mWindowRootView.getFitsSystemWindows() != fitsSystemWindows) { mWindowRootView.setFitsSystemWindows(fitsSystemWindows); mWindowRootView.requestApplyInsets(); |