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

Commit 93654386 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'am-7585e4a8-2edc-4122-a7e4-3366e2146d4b' into ub-launcher3-master

* changes:
  [automerger] Launcher grid changes. am: 30d0aa26 am: 3aa645b7
  [automerger] Launcher grid changes. am: 30d0aa26
  Launcher grid changes.
parents da342e09 e92e6e4e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@
    <dimen name="dynamic_grid_min_page_indicator_size">48dp</dimen>
    <dimen name="dynamic_grid_icon_drawable_padding">4dp</dimen>

    <dimen name="dynamic_grid_cell_layout_padding">0dp</dimen>

    <dimen name="folder_preview_padding">2dp</dimen>

    <!-- Hotseat -->
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
    <!-- Minimum space between workspace and hotseat in spring loaded mode -->
    <dimen name="dynamic_grid_min_spring_loaded_space">8dp</dimen>

    <dimen name="dynamic_grid_cell_layout_padding">5.5dp</dimen>
    <dimen name="dynamic_grid_cell_padding_x">8dp</dimen>

    <!-- Hotseat -->
+13 −9
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@ public class DeviceProfile {
     */
    private static final float MAX_HORIZONTAL_PADDING_PERCENT = 0.14f;

    private static final float TALL_DEVICE_ASPECT_RATIO_THRESHOLD = 1.82f;

    // Overview mode
    private final int overviewModeMinIconZoneHeightPx;
    private final int overviewModeMaxIconZoneHeightPx;
@@ -173,7 +175,8 @@ public class DeviceProfile {
        defaultWidgetPadding = AppWidgetHostView.getDefaultPaddingForWidget(context, cn, null);
        edgeMarginPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin);
        desiredWorkspaceLeftRightMarginPx = isVerticalBarLayout() ? 0 : edgeMarginPx;
        cellLayoutPaddingLeftRightPx = isVerticalBarLayout() ? 0 : edgeMarginPx;
        cellLayoutPaddingLeftRightPx =
                res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_padding);
        pageIndicatorSizePx = res.getDimensionPixelSize(
                R.dimen.dynamic_grid_min_page_indicator_size);
        pageIndicatorLandGutterPx = res.getDimensionPixelSize(
@@ -235,18 +238,19 @@ public class DeviceProfile {
        updateAvailableDimensions(dm, res);

        // Now that we have all of the variables calculated, we can tune certain sizes.
        if (!isVerticalBarLayout()) {
        float aspectRatio = ((float) Math.max(availableWidthPx, availableHeightPx))
                / Math.min(availableWidthPx, availableHeightPx);
        boolean isTallDevice = Float.compare(aspectRatio, TALL_DEVICE_ASPECT_RATIO_THRESHOLD) >= 0;
        if (!isVerticalBarLayout() && isPhone && isTallDevice) {
            // We increase the page indicator size when there is extra space.
            // ie. For a display with a large aspect ratio, we can keep the icons on the workspace
            // in portrait mode closer together by increasing the page indicator size.
            int newPageIndicatorSizePx = getCellSize().y - iconSizePx - iconTextSizePx
                    - iconDrawablePaddingOriginalPx;
            if (newPageIndicatorSizePx > pageIndicatorSizePx) {
                pageIndicatorSizePx = newPageIndicatorSizePx;
            // Note: This calculation was created after noticing a pattern in the design spec.
            pageIndicatorSizePx = getCellSize().y - iconSizePx - iconDrawablePaddingPx;

            // Recalculate the available dimensions using the new page indicator size.
            updateAvailableDimensions(dm, res);
        }
        }

        computeAllAppsButtonSize(context);