mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:28:10 +00:00
Merge changes from topic "taskbar-crop-tasks" into sc-v2-dev
* changes: Extend taskbar color to entire screen in overview Use WindowBounds#insets instead of WindowInsets in DeviceProfile
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package com.android.launcher3;
|
||||
|
||||
import static android.util.DisplayMetrics.DENSITY_DEVICE_STABLE;
|
||||
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
|
||||
|
||||
import static com.android.launcher3.ResourceUtils.pxFromDp;
|
||||
import static com.android.launcher3.Utilities.dpiFromPx;
|
||||
@@ -33,11 +32,8 @@ import android.graphics.Path;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.Rect;
|
||||
import android.hardware.display.DisplayManager;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Surface;
|
||||
import android.view.WindowInsets;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.android.launcher3.CellLayout.ContainerType;
|
||||
import com.android.launcher3.DevicePaddings.DevicePadding;
|
||||
@@ -214,6 +210,8 @@ public class DeviceProfile {
|
||||
|
||||
// Taskbar
|
||||
public boolean isTaskbarPresent;
|
||||
// Whether Taskbar will inset the bottom of apps by taskbarSize.
|
||||
public boolean isTaskbarPresentInApps;
|
||||
public int taskbarSize;
|
||||
// How much of the bottom inset is due to Taskbar rather than other system elements.
|
||||
public int nonOverlappingTaskbarInset;
|
||||
@@ -267,13 +265,7 @@ public class DeviceProfile {
|
||||
// Taskbar will be added later, but provides bottom insets that we should subtract
|
||||
// from availableHeightPx.
|
||||
taskbarSize = res.getDimensionPixelSize(R.dimen.taskbar_size);
|
||||
WindowInsets windowInsets =
|
||||
context.createWindowContext(
|
||||
context.getSystemService(DisplayManager.class).getDisplay(mInfo.id),
|
||||
TYPE_APPLICATION, null)
|
||||
.getSystemService(WindowManager.class)
|
||||
.getCurrentWindowMetrics().getWindowInsets();
|
||||
nonOverlappingTaskbarInset = taskbarSize - windowInsets.getSystemWindowInsetBottom();
|
||||
nonOverlappingTaskbarInset = taskbarSize - windowBounds.insets.bottom;
|
||||
if (nonOverlappingTaskbarInset > 0) {
|
||||
nonFinalAvailableHeightPx -= nonOverlappingTaskbarInset;
|
||||
}
|
||||
@@ -1089,6 +1081,7 @@ public class DeviceProfile {
|
||||
writer.println(prefix + "\tnumShownHotseatIcons: " + numShownHotseatIcons);
|
||||
|
||||
writer.println(prefix + "\tisTaskbarPresent:" + isTaskbarPresent);
|
||||
writer.println(prefix + "\tisTaskbarPresentInApps:" + isTaskbarPresentInApps);
|
||||
|
||||
writer.println(prefix + pxToDpStr("taskbarSize", taskbarSize));
|
||||
writer.println(prefix + pxToDpStr("nonOverlappingTaskbarInset",
|
||||
|
||||
Reference in New Issue
Block a user