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

Commit 802dab90 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7579381 from 6d9e8666 to sc-release

Change-Id: If33c6ceca109e536ce042fdec4b87760187a7cb6
parents 6bbfc88f 6d9e8666
Loading
Loading
Loading
Loading
+21 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.quickstep.views;

import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.Utilities.EDGE_NAV_BAR;
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_7;
@@ -67,6 +68,8 @@ public class AllAppsEduView extends AbstractFloatingView {
    private int mWidthPx;
    private int mMaxHeightPx;

    private boolean mCanInterceptTouch;

    public AllAppsEduView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mCircle = (GradientDrawable) context.getDrawable(R.drawable.all_apps_edu_circle);
@@ -116,16 +119,27 @@ public class AllAppsEduView extends AbstractFloatingView {
        return true;
    }


    private boolean shouldInterceptTouch(MotionEvent ev) {
        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
            mCanInterceptTouch = (ev.getEdgeFlags() & EDGE_NAV_BAR) == 0;
        }
        return mCanInterceptTouch;
    }

    @Override
    public boolean onControllerTouchEvent(MotionEvent ev) {
        if (shouldInterceptTouch(ev)) {
            mTouchController.onControllerTouchEvent(ev);
        if (mAnimation != null) {
            updateAnimationOnTouchEvent(ev);
        }
        return super.onControllerTouchEvent(ev);
        return true;
    }

    private void updateAnimationOnTouchEvent(MotionEvent ev) {
        if (mAnimation == null) {
            return;
        }
        switch (ev.getActionMasked()) {
            case MotionEvent.ACTION_DOWN:
                mAnimation.pause();
@@ -144,7 +158,10 @@ public class AllAppsEduView extends AbstractFloatingView {

    @Override
    public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
        if (shouldInterceptTouch(ev)) {
            mTouchController.onControllerInterceptTouchEvent(ev);
            updateAnimationOnTouchEvent(ev);
        }
        return true;
    }

+0 −1
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@
            style="@style/TextHeadline"
            android:layout_weight="1"
            android:background="@android:color/transparent"
            android:textStyle="bold"
            android:gravity="center_horizontal"
            android:hint="@string/folder_hint_text"
            android:imeOptions="flagNoExtractUi"
+49 −10
Original line number Diff line number Diff line
@@ -31,32 +31,72 @@
    </device-padding>

    <device-padding
        launcher:maxEmptySpace="97dp">
        launcher:maxEmptySpace="100dp">
        <workspaceTopPadding
            launcher:a="0"
            launcher:b="16dp"/>
            launcher:b="9dp"/>
        <workspaceBottomPadding
            launcher:a="0.56"
            launcher:a="0.40"
            launcher:b="0"
            launcher:c="9dp"/>
        <hotseatBottomPadding
            launcher:a="0.60"
            launcher:b="0"
            launcher:c="16dp"/>
            launcher:c="9dp"/>
    </device-padding>

    <device-padding
        launcher:maxEmptySpace="103dp">
        <workspaceTopPadding
            launcher:a="0"
            launcher:b="26dp"/>
        <workspaceBottomPadding
            launcher:a="0"
            launcher:b="20dp"/>
        <hotseatBottomPadding
            launcher:a="0.44"
            launcher:a="1"
            launcher:b="0"
            launcher:c="16dp"/>
            launcher:c="46dp"/>
    </device-padding>

    <device-padding
        launcher:maxEmptySpace="107dp">
        <workspaceTopPadding
            launcher:a="0"
            launcher:b="16dp"/>
            launcher:b="9dp"/>
        <workspaceBottomPadding
            launcher:a="0"
            launcher:b="36dp"/>
            launcher:b="34dp"/>
        <hotseatBottomPadding
            launcher:a="1"
            launcher:b="0"
            launcher:c="52dp"/>
            launcher:c="43dp"/>
    </device-padding>

    <device-padding
        launcher:maxEmptySpace="120dp">
        <workspaceTopPadding
            launcher:a="0"
            launcher:b="16dp"/>
        <workspaceBottomPadding
            launcher:a="1"
            launcher:c="72dp"/>
        <hotseatBottomPadding
            launcher:a="0"
            launcher:b="56dp"/>
    </device-padding>

    <device-padding
        launcher:maxEmptySpace="135dp">
        <workspaceTopPadding
            launcher:a="0"
            launcher:b="39dp"/>
        <workspaceBottomPadding
            launcher:a="1"
            launcher:c="95dp"/>
        <hotseatBottomPadding
            launcher:a="0"
            launcher:b="56dp"/>
    </device-padding>

    <device-padding
@@ -71,5 +111,4 @@
            launcher:a="0"
            launcher:b="36dp"/>
    </device-padding>

</device-paddings>
 No newline at end of file
+3 −2
Original line number Diff line number Diff line
@@ -566,9 +566,10 @@ public class CellLayout extends ViewGroup {
                int spanX = mDragOutlines[i].cellHSpan;
                int spanY = mDragOutlines[i].cellVSpan;

                // TODO b/194414754 clean this up, reconcile with cellToRect
                mVisualizeGridRect.set(paddingX, paddingY,
                        mCellWidth * spanX - paddingX,
                        mCellHeight * spanY - paddingY);
                        mCellWidth * spanX + mBorderSpacing * (spanX - 1) - paddingX,
                        mCellHeight * spanY + mBorderSpacing * (spanY - 1) - paddingY);

                int transX = x * mCellWidth + (x * mBorderSpacing)
                        + getPaddingLeft() + paddingX;
+31 −10
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ public class DeviceProfile {
    private static final float MAX_HORIZONTAL_PADDING_PERCENT = 0.14f;

    private static final float TALL_DEVICE_ASPECT_RATIO_THRESHOLD = 2.0f;
    private static final float TALLER_DEVICE_ASPECT_RATIO_THRESHOLD = 2.15f;

    // To evenly space the icons, increase the left/right margins for tablets in portrait mode.
    private static final int PORTRAIT_TABLET_LEFT_RIGHT_PADDING_MULTIPLIER = 4;
@@ -149,12 +150,13 @@ public class DeviceProfile {
    public int folderChildDrawablePaddingPx;

    // Hotseat
    public int hotseatBarSizeExtraSpacePx;
    public final int numShownHotseatIcons;
    public int hotseatCellHeightPx;
    private final int hotseatExtraVerticalSize;
    // In portrait: size = height, in landscape: size = width
    public int hotseatBarSizePx;
    public final int hotseatBarTopPaddingPx;
    public int hotseatBarTopPaddingPx;
    public final int hotseatBarBottomPaddingPx;
    // Start is the side next to the nav bar, end is the side next to the workspace
    public final int hotseatBarSidePaddingStartPx;
@@ -323,6 +325,7 @@ public class DeviceProfile {
                isTwoPanels ? inv.numDatabaseHotseatIcons : inv.numShownHotseatIcons;
        numShownAllAppsColumns =
                isTwoPanels ? inv.numDatabaseAllAppsColumns : inv.numAllAppsColumns;
        hotseatBarSizeExtraSpacePx = 0;
        hotseatBarTopPaddingPx =
                res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_top_padding);
        hotseatBarBottomPaddingPx = (isTallDevice ? 0
@@ -353,6 +356,7 @@ public class DeviceProfile {

        // Calculate all of the remaining variables.
        extraSpace = updateAvailableDimensions(res);

        // Now that we have all of the variables calculated, we can tune certain sizes.
        if (isScalableGrid && inv.devicePaddings != null) {
            // Paddings were created assuming no scaling, so we first unscale the extra space.
@@ -372,12 +376,25 @@ public class DeviceProfile {
            qsbBottomMarginPx = Math.round(qsbBottomMarginOriginalPx * cellScaleToFit);
        } else if (!isVerticalBarLayout() && isPhone && isTallDevice) {
            // We increase the hotseat 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 adding more height to the hotseat.

            if (Float.compare(aspectRatio, TALLER_DEVICE_ASPECT_RATIO_THRESHOLD) >= 0) {
                // For taller devices, we will take a third of the extra space from each row,
                // and add it to the space above and below the hotseat.
                int extraSpace = ((getCellSize().y - iconSizePx - iconDrawablePaddingPx * 2)
                        * inv.numRows) / 3;

                int halfExtraSpace = extraSpace / 2;
                hotseatBarTopPaddingPx += halfExtraSpace;
                hotseatBarSizeExtraSpacePx = halfExtraSpace;
            } else {
                // ie. For a display with a large aspect ratio, we can keep the icons on the
                // workspace in portrait mode closer together by adding more height to the hotseat.
                // Note: This calculation was created after noticing a pattern in the design spec.
            int extraSpace = getCellSize().y - iconSizePx - iconDrawablePaddingPx * 2
                    - workspacePageIndicatorHeight;
            hotseatBarSizePx += extraSpace;
                hotseatBarSizeExtraSpacePx = getCellSize().y - iconSizePx
                        - iconDrawablePaddingPx * 2 - workspacePageIndicatorHeight;
            }

            updateHotseatIconSize(iconSizePx);

            // Recalculate the available dimensions using the new hotseat size.
            updateAvailableDimensions(res);
@@ -402,7 +419,8 @@ public class DeviceProfile {
                    + hotseatBarSidePaddingEndPx;
        } else {
            hotseatBarSizePx = hotseatIconSizePx + hotseatBarTopPaddingPx
                    + hotseatBarBottomPaddingPx + (isScalableGrid ? 0 : hotseatExtraVerticalSize);
                    + hotseatBarBottomPaddingPx + (isScalableGrid ? 0 : hotseatExtraVerticalSize)
                    + hotseatBarSizeExtraSpacePx;
        }
    }

@@ -652,8 +670,11 @@ public class DeviceProfile {
        int textHeight = Utilities.calculateTextHeight(folderChildTextSizePx);

        if (isScalableGrid) {
            folderCellWidthPx = (int) (cellWidthPx * scale);
            folderCellHeightPx = (int) (cellHeightPx * scale);
            int minWidth = folderChildIconSizePx + iconDrawablePaddingPx * 2;
            int minHeight = folderChildIconSizePx + iconDrawablePaddingPx * 2 + textHeight;

            folderCellWidthPx = (int) Math.max(minWidth, cellWidthPx * scale);
            folderCellHeightPx = (int) Math.max(minHeight, cellHeightPx * scale);

            int borderSpacing = (int) (cellLayoutBorderSpacingOriginalPx * scale);
            folderCellLayoutBorderSpacingPx = borderSpacing;
Loading