From 0c32760b3c47292776891aa69903ff7fdee2fed6 Mon Sep 17 00:00:00 2001 From: Ajinkya Chalke Date: Thu, 8 May 2025 00:21:52 +0000 Subject: [PATCH] Use custom height for all apps for CD Bug: 416220478 Flag: com.android.window.flags.enable_taskbar_connected_displays Test: m Change-Id: I772c43cec98e5a2679324603bee128482c614e26 --- .../taskbar/allapps/TaskbarAllAppsController.java | 13 +++++++++++++ res/values/dimens.xml | 2 ++ 2 files changed, 15 insertions(+) diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java index 7ada818860..435a0f6efc 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java @@ -17,7 +17,9 @@ package com.android.launcher3.taskbar.allapps; import static com.android.launcher3.model.data.AppInfo.EMPTY_ARRAY; +import android.view.Gravity; import android.view.View; +import android.window.DesktopExperienceFlags; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -31,6 +33,7 @@ import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.taskbar.TaskbarControllers; import com.android.launcher3.taskbar.overlay.TaskbarOverlayContext; import com.android.launcher3.util.PackageUserKey; +import com.android.launcher3.views.BaseDragLayer.LayoutParams; import java.util.Collections; import java.util.List; @@ -165,6 +168,16 @@ public final class TaskbarAllAppsController { mSlideInView = (TaskbarAllAppsSlideInView) mOverlayContext.getLayoutInflater().inflate( R.layout.taskbar_all_apps_sheet, mOverlayContext.getDragLayer(), false); + + if (!mOverlayContext.isPrimaryDisplay() + && DesktopExperienceFlags.ENABLE_TASKBAR_CONNECTED_DISPLAYS.isTrue()) { + LayoutParams lp = (LayoutParams) mSlideInView.getLayoutParams(); + lp.height = mOverlayContext.getResources().getDimensionPixelSize( + R.dimen.all_apps_secondary_display_height); + lp.gravity = Gravity.BOTTOM; + mSlideInView.setLayoutParams(lp); + } + // Ensures All Apps gets touch events in case it is not the top floating view. Floating // views above it may not be able to intercept the touch, so All Apps should try to. mOverlayContext.getDragLayer().addTouchController(mSlideInView); diff --git a/res/values/dimens.xml b/res/values/dimens.xml index eaf19ca6c7..a7692e0715 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -156,6 +156,8 @@ 8dp + 900dp + 56dp 16dp