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

Commit 3bb6d4bd authored by fbaron's avatar fbaron Committed by Federico Baron
Browse files

Update some dimens for portrait edit state

Fix: 324133830
Flag: NONE
Test: HomeScreenEditImageTest
Change-Id: I7f42664b63e6981bcef5db2e76129bd3fe567102
parent cb5d2ab7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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>

@@ -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 -->
+15 −4
Original line number Diff line number Diff line
@@ -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;
@@ -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(
@@ -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());
+6 −6
Original line number Diff line number Diff line
@@ -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)
@@ -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)
+6 −6
Original line number Diff line number Diff line
@@ -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)
@@ -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)