From dc32a1e213fef28ef54e9bcb8cf973cf4d7178f2 Mon Sep 17 00:00:00 2001 From: kwaky Date: Tue, 6 Oct 2020 17:00:33 -0700 Subject: [PATCH] Handle System Bar Inset properly for immersive mode. If we enter immersive mode (that is, SystemBar is hidden due to transient mode), inset from that system bar is not applied even when it becomes visible. To fix this, we are applying window inset to fit ignoring the visibility of the system bar. Each overlay view can opt-in to use this functionality by overriding shouldUseStableInsets's return value to true. It can also use conditionals to change its return value dynamically (e.g. depending on whether the IME is visible. See NotificationPanelViewController.) Bug: 169612767 Test: Manual (see screen shots) Change-Id: I9d0c460bd3b521f9e334c3f7c9d304e68593b6da --- .../res/layout/sysui_overlay_window.xml | 3 +-- .../NotificationPanelViewController.java | 27 +++++++------------ .../car/window/OverlayViewController.java | 13 +++++++++ .../OverlayViewGlobalStateController.java | 8 ++++++ .../SystemUIOverlayWindowController.java | 6 +++++ 5 files changed, 38 insertions(+), 19 deletions(-) diff --git a/packages/CarSystemUI/res/layout/sysui_overlay_window.xml b/packages/CarSystemUI/res/layout/sysui_overlay_window.xml index e7295aa6383d0..2c9788955bfa4 100644 --- a/packages/CarSystemUI/res/layout/sysui_overlay_window.xml +++ b/packages/CarSystemUI/res/layout/sysui_overlay_window.xml @@ -25,8 +25,7 @@ + android:layout="@layout/notification_panel_container"/>