[Foldable] Apply max width to AllApps in unfolded state.

Since we are applying the same iconWidth in AllApps as Workspace in unfolded state, this change restricts AllApps to span only the area required to display AllApps contents and not span full available width. Unfolded/phone behavior remains the same.

Bug: 199959857
Bug: 194259694
Test: visual
Change-Id: Ie5658d566f20e825e666ef17db79a87b07dc2936
This commit is contained in:
sfufa@google.com
2021-09-21 18:22:44 -07:00
parent c9ef011e54
commit de0132939b
6 changed files with 39 additions and 15 deletions
@@ -400,12 +400,10 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
public void setInsets(Rect insets) {
mInsets.set(insets);
DeviceProfile grid = mLauncher.getDeviceProfile();
int leftRightPadding = grid.desiredWorkspaceLeftRightMarginPx
+ grid.cellLayoutPaddingLeftRightPx;
for (int i = 0; i < mAH.length; i++) {
mAH[i].padding.bottom = insets.bottom;
mAH[i].padding.left = mAH[i].padding.right = leftRightPadding;
mAH[i].padding.left = mAH[i].padding.right = grid.allAppsLeftRightPadding;
mAH[i].applyPadding();
}