From 20af9304cb417ea9af5df1521678ebb164bbcc72 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Mon, 4 Apr 2022 17:39:31 +0100 Subject: [PATCH] Override statusBar top inset in Launcher Fix: 227600170 Test: manual on small and large screen devices Change-Id: I1b0dacaf555db966d1e2a837310d9cebe3e60d7a --- .../launcher3/util/window/WindowManagerProxy.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/com/android/launcher3/util/window/WindowManagerProxy.java b/src/com/android/launcher3/util/window/WindowManagerProxy.java index 2fd0a7eb6a..5aaa2750d1 100644 --- a/src/com/android/launcher3/util/window/WindowManagerProxy.java +++ b/src/com/android/launcher3/util/window/WindowManagerProxy.java @@ -165,6 +165,17 @@ public class WindowManagerProxy implements ResourceBasedOverride { insetsBuilder.setInsets(WindowInsets.Type.navigationBars(), newNavInsets); insetsBuilder.setInsetsIgnoringVisibility(WindowInsets.Type.navigationBars(), newNavInsets); + Insets statusBarInsets = oldInsets.getInsets(WindowInsets.Type.statusBars()); + int statusBarHeight = getDimenByName("status_bar_height", systemRes, 0); + Insets newStatusBarInsets = Insets.of( + statusBarInsets.left, + Math.max(statusBarInsets.top, statusBarHeight), + statusBarInsets.right, + statusBarInsets.bottom); + insetsBuilder.setInsets(WindowInsets.Type.statusBars(), newStatusBarInsets); + insetsBuilder.setInsetsIgnoringVisibility( + WindowInsets.Type.statusBars(), newStatusBarInsets); + // Override the tappable insets to be 0 on the bottom for gesture nav (otherwise taskbar // would count towards it). This is used for the bottom protection in All Apps for example. if (isGesture) {