Loading res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ <!-- Hotseat --> <dimen name="dynamic_grid_hotseat_bottom_tall_padding">0dp</dimen> <dimen name="spring_loaded_hotseat_top_margin">76dp</dimen> <dimen name="spring_loaded_hotseat_top_margin_wide_portrait">64dp</dimen> <dimen name="dynamic_grid_hotseat_side_padding">0dp</dimen> Loading @@ -47,6 +48,7 @@ <dimen name="drop_target_vertical_gap">20dp</dimen> <dimen name="drop_target_top_margin">32dp</dimen> <dimen name="drop_target_bottom_margin">16dp</dimen> <dimen name="drop_target_bottom_margin_wide_portrait">32dp</dimen> <!-- App Widget resize frame --> <!-- Button drop target bar --> Loading src/com/android/launcher3/DeviceProfile.java +15 −4 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public class DeviceProfile { // Minimum aspect ratio beyond which an extra top padding may be applied to a bottom sheet. private static final float MIN_ASPECT_RATIO_FOR_EXTRA_TOP_PADDING = 1.5f; private static final float MAX_ASPECT_RATIO_FOR_ALTERNATE_EDIT_STATE = 1.5f; public static final PointF DEFAULT_SCALE = new PointF(1.0f, 1.0f); public static final ViewScaleProvider DEFAULT_PROVIDER = itemInfo -> DEFAULT_SCALE; Loading Loading @@ -500,8 +501,17 @@ public class DeviceProfile { } dropTargetBarSizePx = res.getDimensionPixelSize(R.dimen.dynamic_grid_drop_target_size); dropTargetBarTopMarginPx = res.getDimensionPixelSize(R.dimen.drop_target_top_margin); dropTargetBarBottomMarginPx = res.getDimensionPixelSize(R.dimen.drop_target_bottom_margin); // Some foldable portrait modes are too wide in terms of aspect ratio so we need to tweak // the dimensions for edit state. final boolean shouldApplyWidePortraitDimens = isTablet && !isLandscape && aspectRatio < MAX_ASPECT_RATIO_FOR_ALTERNATE_EDIT_STATE; dropTargetBarTopMarginPx = shouldApplyWidePortraitDimens ? 0 : res.getDimensionPixelSize(R.dimen.drop_target_top_margin); dropTargetBarBottomMarginPx = shouldApplyWidePortraitDimens ? res.getDimensionPixelSize(R.dimen.drop_target_bottom_margin_wide_portrait) : res.getDimensionPixelSize(R.dimen.drop_target_bottom_margin); dropTargetDragPaddingPx = res.getDimensionPixelSize(R.dimen.drop_target_drag_padding); dropTargetTextSizePx = res.getDimensionPixelSize(R.dimen.drop_target_text_size); dropTargetHorizontalPaddingPx = res.getDimensionPixelSize( Loading Loading @@ -592,8 +602,9 @@ public class DeviceProfile { } } springLoadedHotseatBarTopMarginPx = res.getDimensionPixelSize( R.dimen.spring_loaded_hotseat_top_margin); springLoadedHotseatBarTopMarginPx = shouldApplyWidePortraitDimens ? res.getDimensionPixelSize(R.dimen.spring_loaded_hotseat_top_margin_wide_portrait) : res.getDimensionPixelSize(R.dimen.spring_loaded_hotseat_top_margin); if (mIsResponsiveGrid) { updateHotseatSizes(mResponsiveWorkspaceCellSpec.getIconSize()); Loading tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait.txt +6 −6 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ DeviceProfile: hotseatBarEndOffset: 0.0px (0.0dp) hotseatQsbSpace: 0.0px (0.0dp) hotseatQsbHeight: 0.0px (0.0dp) springLoadedHotseatBarTopMarginPx: 171.0px (65.14286dp) springLoadedHotseatBarTopMarginPx: 168.0px (64.0dp) getHotseatLayoutPadding(context).top: 0.0px (0.0dp) getHotseatLayoutPadding(context).bottom: 108.0px (41.142857dp) getHotseatLayoutPadding(context).left: 98.0px (37.333332dp) Loading Loading @@ -118,12 +118,12 @@ DeviceProfile: overviewPageSpacing: 0.0px (0.0dp) overviewRowSpacing: 0.0px (0.0dp) overviewGridSideMargin: 0.0px (0.0dp) dropTargetBarTopMarginPx: 168.0px (64.0dp) dropTargetBarTopMarginPx: 0.0px (0.0dp) dropTargetBarSizePx: 147.0px (56.0dp) dropTargetBarBottomMarginPx: 42.0px (16.0dp) getCellLayoutSpringLoadShrunkTop(): 490.0px (186.66667dp) getCellLayoutSpringLoadShrunkBottom(): 1770.0px (674.2857dp) dropTargetBarBottomMarginPx: 84.0px (32.0dp) getCellLayoutSpringLoadShrunkTop(): 364.0px (138.66667dp) getCellLayoutSpringLoadShrunkBottom(): 1773.0px (675.4286dp) workspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp) getWorkspaceSpringLoadScale(): 0.7437536px (0.2833347dp) getWorkspaceSpringLoadScale(): 0.81871px (0.31188953dp) getCellLayoutHeight(): 1721.0px (655.619dp) getCellLayoutWidth(): 899.0px (342.4762dp) tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait3Button.txt +6 −6 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ DeviceProfile: hotseatBarEndOffset: 0.0px (0.0dp) hotseatQsbSpace: 0.0px (0.0dp) hotseatQsbHeight: 0.0px (0.0dp) springLoadedHotseatBarTopMarginPx: 171.0px (65.14286dp) springLoadedHotseatBarTopMarginPx: 168.0px (64.0dp) getHotseatLayoutPadding(context).top: 0.0px (0.0dp) getHotseatLayoutPadding(context).bottom: 108.0px (41.142857dp) getHotseatLayoutPadding(context).left: 98.0px (37.333332dp) Loading Loading @@ -118,12 +118,12 @@ DeviceProfile: overviewPageSpacing: 0.0px (0.0dp) overviewRowSpacing: 0.0px (0.0dp) overviewGridSideMargin: 0.0px (0.0dp) dropTargetBarTopMarginPx: 168.0px (64.0dp) dropTargetBarTopMarginPx: 0.0px (0.0dp) dropTargetBarSizePx: 147.0px (56.0dp) dropTargetBarBottomMarginPx: 42.0px (16.0dp) getCellLayoutSpringLoadShrunkTop(): 490.0px (186.66667dp) getCellLayoutSpringLoadShrunkBottom(): 1770.0px (674.2857dp) dropTargetBarBottomMarginPx: 84.0px (32.0dp) getCellLayoutSpringLoadShrunkTop(): 364.0px (138.66667dp) getCellLayoutSpringLoadShrunkBottom(): 1773.0px (675.4286dp) workspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp) getWorkspaceSpringLoadScale(): 0.7437536px (0.2833347dp) getWorkspaceSpringLoadScale(): 0.81871px (0.31188953dp) getCellLayoutHeight(): 1721.0px (655.619dp) getCellLayoutWidth(): 899.0px (342.4762dp) Loading
res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ <!-- Hotseat --> <dimen name="dynamic_grid_hotseat_bottom_tall_padding">0dp</dimen> <dimen name="spring_loaded_hotseat_top_margin">76dp</dimen> <dimen name="spring_loaded_hotseat_top_margin_wide_portrait">64dp</dimen> <dimen name="dynamic_grid_hotseat_side_padding">0dp</dimen> Loading @@ -47,6 +48,7 @@ <dimen name="drop_target_vertical_gap">20dp</dimen> <dimen name="drop_target_top_margin">32dp</dimen> <dimen name="drop_target_bottom_margin">16dp</dimen> <dimen name="drop_target_bottom_margin_wide_portrait">32dp</dimen> <!-- App Widget resize frame --> <!-- Button drop target bar --> Loading
src/com/android/launcher3/DeviceProfile.java +15 −4 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public class DeviceProfile { // Minimum aspect ratio beyond which an extra top padding may be applied to a bottom sheet. private static final float MIN_ASPECT_RATIO_FOR_EXTRA_TOP_PADDING = 1.5f; private static final float MAX_ASPECT_RATIO_FOR_ALTERNATE_EDIT_STATE = 1.5f; public static final PointF DEFAULT_SCALE = new PointF(1.0f, 1.0f); public static final ViewScaleProvider DEFAULT_PROVIDER = itemInfo -> DEFAULT_SCALE; Loading Loading @@ -500,8 +501,17 @@ public class DeviceProfile { } dropTargetBarSizePx = res.getDimensionPixelSize(R.dimen.dynamic_grid_drop_target_size); dropTargetBarTopMarginPx = res.getDimensionPixelSize(R.dimen.drop_target_top_margin); dropTargetBarBottomMarginPx = res.getDimensionPixelSize(R.dimen.drop_target_bottom_margin); // Some foldable portrait modes are too wide in terms of aspect ratio so we need to tweak // the dimensions for edit state. final boolean shouldApplyWidePortraitDimens = isTablet && !isLandscape && aspectRatio < MAX_ASPECT_RATIO_FOR_ALTERNATE_EDIT_STATE; dropTargetBarTopMarginPx = shouldApplyWidePortraitDimens ? 0 : res.getDimensionPixelSize(R.dimen.drop_target_top_margin); dropTargetBarBottomMarginPx = shouldApplyWidePortraitDimens ? res.getDimensionPixelSize(R.dimen.drop_target_bottom_margin_wide_portrait) : res.getDimensionPixelSize(R.dimen.drop_target_bottom_margin); dropTargetDragPaddingPx = res.getDimensionPixelSize(R.dimen.drop_target_drag_padding); dropTargetTextSizePx = res.getDimensionPixelSize(R.dimen.drop_target_text_size); dropTargetHorizontalPaddingPx = res.getDimensionPixelSize( Loading Loading @@ -592,8 +602,9 @@ public class DeviceProfile { } } springLoadedHotseatBarTopMarginPx = res.getDimensionPixelSize( R.dimen.spring_loaded_hotseat_top_margin); springLoadedHotseatBarTopMarginPx = shouldApplyWidePortraitDimens ? res.getDimensionPixelSize(R.dimen.spring_loaded_hotseat_top_margin_wide_portrait) : res.getDimensionPixelSize(R.dimen.spring_loaded_hotseat_top_margin); if (mIsResponsiveGrid) { updateHotseatSizes(mResponsiveWorkspaceCellSpec.getIconSize()); Loading
tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait.txt +6 −6 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ DeviceProfile: hotseatBarEndOffset: 0.0px (0.0dp) hotseatQsbSpace: 0.0px (0.0dp) hotseatQsbHeight: 0.0px (0.0dp) springLoadedHotseatBarTopMarginPx: 171.0px (65.14286dp) springLoadedHotseatBarTopMarginPx: 168.0px (64.0dp) getHotseatLayoutPadding(context).top: 0.0px (0.0dp) getHotseatLayoutPadding(context).bottom: 108.0px (41.142857dp) getHotseatLayoutPadding(context).left: 98.0px (37.333332dp) Loading Loading @@ -118,12 +118,12 @@ DeviceProfile: overviewPageSpacing: 0.0px (0.0dp) overviewRowSpacing: 0.0px (0.0dp) overviewGridSideMargin: 0.0px (0.0dp) dropTargetBarTopMarginPx: 168.0px (64.0dp) dropTargetBarTopMarginPx: 0.0px (0.0dp) dropTargetBarSizePx: 147.0px (56.0dp) dropTargetBarBottomMarginPx: 42.0px (16.0dp) getCellLayoutSpringLoadShrunkTop(): 490.0px (186.66667dp) getCellLayoutSpringLoadShrunkBottom(): 1770.0px (674.2857dp) dropTargetBarBottomMarginPx: 84.0px (32.0dp) getCellLayoutSpringLoadShrunkTop(): 364.0px (138.66667dp) getCellLayoutSpringLoadShrunkBottom(): 1773.0px (675.4286dp) workspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp) getWorkspaceSpringLoadScale(): 0.7437536px (0.2833347dp) getWorkspaceSpringLoadScale(): 0.81871px (0.31188953dp) getCellLayoutHeight(): 1721.0px (655.619dp) getCellLayoutWidth(): 899.0px (342.4762dp)
tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait3Button.txt +6 −6 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ DeviceProfile: hotseatBarEndOffset: 0.0px (0.0dp) hotseatQsbSpace: 0.0px (0.0dp) hotseatQsbHeight: 0.0px (0.0dp) springLoadedHotseatBarTopMarginPx: 171.0px (65.14286dp) springLoadedHotseatBarTopMarginPx: 168.0px (64.0dp) getHotseatLayoutPadding(context).top: 0.0px (0.0dp) getHotseatLayoutPadding(context).bottom: 108.0px (41.142857dp) getHotseatLayoutPadding(context).left: 98.0px (37.333332dp) Loading Loading @@ -118,12 +118,12 @@ DeviceProfile: overviewPageSpacing: 0.0px (0.0dp) overviewRowSpacing: 0.0px (0.0dp) overviewGridSideMargin: 0.0px (0.0dp) dropTargetBarTopMarginPx: 168.0px (64.0dp) dropTargetBarTopMarginPx: 0.0px (0.0dp) dropTargetBarSizePx: 147.0px (56.0dp) dropTargetBarBottomMarginPx: 42.0px (16.0dp) getCellLayoutSpringLoadShrunkTop(): 490.0px (186.66667dp) getCellLayoutSpringLoadShrunkBottom(): 1770.0px (674.2857dp) dropTargetBarBottomMarginPx: 84.0px (32.0dp) getCellLayoutSpringLoadShrunkTop(): 364.0px (138.66667dp) getCellLayoutSpringLoadShrunkBottom(): 1773.0px (675.4286dp) workspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp) getWorkspaceSpringLoadScale(): 0.7437536px (0.2833347dp) getWorkspaceSpringLoadScale(): 0.81871px (0.31188953dp) getCellLayoutHeight(): 1721.0px (655.619dp) getCellLayoutWidth(): 899.0px (342.4762dp)