Loading quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +1 −1 Original line number Diff line number Diff line Loading @@ -222,7 +222,7 @@ public abstract class BaseQuickstepLauncher extends Launcher mTaskbarController.cleanup(); mTaskbarController = null; } if (FeatureFlags.ENABLE_TASKBAR.get() && mDeviceProfile.isTablet) { if (mDeviceProfile.isTaskbarPresent) { TaskbarActivityContext taskbarActivityContext = new TaskbarActivityContext(this); mTaskbarController = new TaskbarController(this, taskbarActivityContext.getTaskbarContainerView()); Loading quickstep/src/com/android/launcher3/taskbar/TaskbarController.java +4 −8 Original line number Diff line number Diff line Loading @@ -89,8 +89,7 @@ public class TaskbarController { mTaskbarView = mTaskbarContainerView.findViewById(R.id.taskbar_view); mTaskbarView.construct(createTaskbarViewCallbacks()); mWindowManager = mLauncher.getWindowManager(); mTaskbarSize = new Point(MATCH_PARENT, mLauncher.getResources().getDimensionPixelSize(R.dimen.taskbar_size)); mTaskbarSize = new Point(MATCH_PARENT, mLauncher.getDeviceProfile().taskbarSize); mTaskbarStateHandler = mLauncher.getTaskbarStateHandler(); mTaskbarVisibilityController = new TaskbarVisibilityController(mLauncher, createTaskbarVisibilityControllerCallbacks()); Loading Loading @@ -233,14 +232,10 @@ public class TaskbarController { } private void removeFromWindowManager() { if (mTaskbarContainerView.isAttachedToWindow()) { mWindowManager.removeViewImmediate(mTaskbarContainerView); } } private void addToWindowManager() { removeFromWindowManager(); final int gravity = Gravity.BOTTOM; mWindowLayoutParams = new WindowManager.LayoutParams( Loading Loading @@ -378,7 +373,8 @@ public class TaskbarController { * @return Whether the given View is in the same window as Taskbar. */ public boolean isViewInTaskbar(View v) { return mTaskbarContainerView.getWindowId().equals(v.getWindowId()); return mTaskbarContainerView.isAttachedToWindow() && mTaskbarContainerView.getWindowId().equals(v.getWindowId()); } /** Loading res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -260,4 +260,7 @@ <dimen name="search_settings_icon_vertical_offset">16dp</dimen> <dimen name="search_line_spacing">4dp</dimen> <!-- Taskbar related (placeholders to compile in Launcher3 without Quickstep) --> <dimen name="taskbar_size">0dp</dimen> </resources> src/com/android/launcher3/DeviceProfile.java +26 −2 Original line number Diff line number Diff line Loading @@ -25,9 +25,12 @@ import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; import android.view.Surface; import android.view.WindowInsets; import android.view.WindowManager; import com.android.launcher3.CellLayout.ContainerType; import com.android.launcher3.DevicePaddings.DevicePadding; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.graphics.IconShape; import com.android.launcher3.icons.DotRenderer; import com.android.launcher3.icons.IconNormalizer; Loading Loading @@ -149,6 +152,10 @@ public class DeviceProfile { public DotRenderer mDotRendererWorkSpace; public DotRenderer mDotRendererAllApps; // Taskbar public boolean isTaskbarPresent; public int taskbarSize; DeviceProfile(Context context, InvariantDeviceProfile inv, Info info, Point minSize, Point maxSize, int width, int height, boolean isLandscape, boolean isMultiWindowMode, boolean transposeLayoutWithOrientation, Loading @@ -163,12 +170,13 @@ public class DeviceProfile { // Determine sizes. widthPx = width; heightPx = height; int nonFinalAvailableHeightPx; if (isLandscape) { availableWidthPx = maxSize.x; availableHeightPx = minSize.y; nonFinalAvailableHeightPx = minSize.y; } else { availableWidthPx = minSize.x; availableHeightPx = maxSize.y; nonFinalAvailableHeightPx = maxSize.y; } mInfo = info; Loading @@ -192,6 +200,22 @@ public class DeviceProfile { : Configuration.ORIENTATION_PORTRAIT); final Resources res = context.getResources(); isTaskbarPresent = isTablet && FeatureFlags.ENABLE_TASKBAR.get(); if (isTaskbarPresent) { // Taskbar will be added later, but provides bottom insets that we should subtract // from availableHeightPx. taskbarSize = res.getDimensionPixelSize(R.dimen.taskbar_size); WindowInsets windowInsets = DisplayController.INSTANCE.get(context).getHolder(mInfo.id) .getDisplayContext().getSystemService(WindowManager.class) .getCurrentWindowMetrics().getWindowInsets(); int nonOverlappingTaskbarInset = taskbarSize - windowInsets.getSystemWindowInsetBottom(); if (nonOverlappingTaskbarInset > 0) { nonFinalAvailableHeightPx -= nonOverlappingTaskbarInset; } } availableHeightPx = nonFinalAvailableHeightPx; edgeMarginPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin); desiredWorkspaceLeftRightMarginPx = isVerticalBarLayout() ? 0 : edgeMarginPx; Loading src/com/android/launcher3/util/DisplayController.java +4 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,10 @@ public class DisplayController implements DisplayListener { return new Info(displayContext, display); } public Context getDisplayContext() { return mDisplayContext; } protected void handleOnChange() { Info oldInfo = mInfo; Info newInfo = createInfoForContext(mDisplayContext); Loading Loading
quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +1 −1 Original line number Diff line number Diff line Loading @@ -222,7 +222,7 @@ public abstract class BaseQuickstepLauncher extends Launcher mTaskbarController.cleanup(); mTaskbarController = null; } if (FeatureFlags.ENABLE_TASKBAR.get() && mDeviceProfile.isTablet) { if (mDeviceProfile.isTaskbarPresent) { TaskbarActivityContext taskbarActivityContext = new TaskbarActivityContext(this); mTaskbarController = new TaskbarController(this, taskbarActivityContext.getTaskbarContainerView()); Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarController.java +4 −8 Original line number Diff line number Diff line Loading @@ -89,8 +89,7 @@ public class TaskbarController { mTaskbarView = mTaskbarContainerView.findViewById(R.id.taskbar_view); mTaskbarView.construct(createTaskbarViewCallbacks()); mWindowManager = mLauncher.getWindowManager(); mTaskbarSize = new Point(MATCH_PARENT, mLauncher.getResources().getDimensionPixelSize(R.dimen.taskbar_size)); mTaskbarSize = new Point(MATCH_PARENT, mLauncher.getDeviceProfile().taskbarSize); mTaskbarStateHandler = mLauncher.getTaskbarStateHandler(); mTaskbarVisibilityController = new TaskbarVisibilityController(mLauncher, createTaskbarVisibilityControllerCallbacks()); Loading Loading @@ -233,14 +232,10 @@ public class TaskbarController { } private void removeFromWindowManager() { if (mTaskbarContainerView.isAttachedToWindow()) { mWindowManager.removeViewImmediate(mTaskbarContainerView); } } private void addToWindowManager() { removeFromWindowManager(); final int gravity = Gravity.BOTTOM; mWindowLayoutParams = new WindowManager.LayoutParams( Loading Loading @@ -378,7 +373,8 @@ public class TaskbarController { * @return Whether the given View is in the same window as Taskbar. */ public boolean isViewInTaskbar(View v) { return mTaskbarContainerView.getWindowId().equals(v.getWindowId()); return mTaskbarContainerView.isAttachedToWindow() && mTaskbarContainerView.getWindowId().equals(v.getWindowId()); } /** Loading
res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -260,4 +260,7 @@ <dimen name="search_settings_icon_vertical_offset">16dp</dimen> <dimen name="search_line_spacing">4dp</dimen> <!-- Taskbar related (placeholders to compile in Launcher3 without Quickstep) --> <dimen name="taskbar_size">0dp</dimen> </resources>
src/com/android/launcher3/DeviceProfile.java +26 −2 Original line number Diff line number Diff line Loading @@ -25,9 +25,12 @@ import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; import android.view.Surface; import android.view.WindowInsets; import android.view.WindowManager; import com.android.launcher3.CellLayout.ContainerType; import com.android.launcher3.DevicePaddings.DevicePadding; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.graphics.IconShape; import com.android.launcher3.icons.DotRenderer; import com.android.launcher3.icons.IconNormalizer; Loading Loading @@ -149,6 +152,10 @@ public class DeviceProfile { public DotRenderer mDotRendererWorkSpace; public DotRenderer mDotRendererAllApps; // Taskbar public boolean isTaskbarPresent; public int taskbarSize; DeviceProfile(Context context, InvariantDeviceProfile inv, Info info, Point minSize, Point maxSize, int width, int height, boolean isLandscape, boolean isMultiWindowMode, boolean transposeLayoutWithOrientation, Loading @@ -163,12 +170,13 @@ public class DeviceProfile { // Determine sizes. widthPx = width; heightPx = height; int nonFinalAvailableHeightPx; if (isLandscape) { availableWidthPx = maxSize.x; availableHeightPx = minSize.y; nonFinalAvailableHeightPx = minSize.y; } else { availableWidthPx = minSize.x; availableHeightPx = maxSize.y; nonFinalAvailableHeightPx = maxSize.y; } mInfo = info; Loading @@ -192,6 +200,22 @@ public class DeviceProfile { : Configuration.ORIENTATION_PORTRAIT); final Resources res = context.getResources(); isTaskbarPresent = isTablet && FeatureFlags.ENABLE_TASKBAR.get(); if (isTaskbarPresent) { // Taskbar will be added later, but provides bottom insets that we should subtract // from availableHeightPx. taskbarSize = res.getDimensionPixelSize(R.dimen.taskbar_size); WindowInsets windowInsets = DisplayController.INSTANCE.get(context).getHolder(mInfo.id) .getDisplayContext().getSystemService(WindowManager.class) .getCurrentWindowMetrics().getWindowInsets(); int nonOverlappingTaskbarInset = taskbarSize - windowInsets.getSystemWindowInsetBottom(); if (nonOverlappingTaskbarInset > 0) { nonFinalAvailableHeightPx -= nonOverlappingTaskbarInset; } } availableHeightPx = nonFinalAvailableHeightPx; edgeMarginPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin); desiredWorkspaceLeftRightMarginPx = isVerticalBarLayout() ? 0 : edgeMarginPx; Loading
src/com/android/launcher3/util/DisplayController.java +4 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,10 @@ public class DisplayController implements DisplayListener { return new Info(displayContext, display); } public Context getDisplayContext() { return mDisplayContext; } protected void handleOnChange() { Info oldInfo = mInfo; Info newInfo = createInfoForContext(mDisplayContext); Loading