Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b5548c5 authored by Alex Chau's avatar Alex Chau
Browse files

Consider padding when measuring AllApps in SecondaryDragLayer

Fix: 223595498
Test: adb shell am start -a android.intent.action.MAIN -c android.intent.category.SECONDARY_HOME
Change-Id: I2754eb08daf2657e502a22bf7308561f5d0c9a7f
parent 97c6b268
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -120,23 +120,20 @@ public class SecondaryDragLayer extends BaseDragLayer<SecondaryDisplayLauncher>

                int maxWidth =
                        grid.allAppsCellWidthPx * grid.numShownAllAppsColumns + horizontalPadding;
                int appsWidth = Math.min(width, maxWidth);
                int appsWidth = Math.min(width - getPaddingLeft() - getPaddingRight(), maxWidth);

                int maxHeight =
                        grid.allAppsCellHeightPx * grid.numShownAllAppsColumns + verticalPadding;
                int appsHeight = Math.min(height, maxHeight);
                int appsHeight = Math.min(height - getPaddingTop() - getPaddingBottom(), maxHeight);

                mAppsView.measure(
                        makeMeasureSpec(appsWidth, EXACTLY), makeMeasureSpec(appsHeight, EXACTLY));

            } else if (child == mAllAppsButton) {
                int appsButtonSpec = makeMeasureSpec(grid.iconSizePx, EXACTLY);
                mAllAppsButton.measure(appsButtonSpec, appsButtonSpec);

            } else if (child == mWorkspace) {
                measureChildWithMargins(mWorkspace, widthMeasureSpec, 0, heightMeasureSpec,
                        grid.iconSizePx + grid.edgeMarginPx);

            } else {
                measureChildWithMargins(child, widthMeasureSpec, 0, heightMeasureSpec, 0);
            }