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

Commit ada8d7df authored by Adam Cohen's avatar Adam Cohen Committed by Android (Google) Code Review
Browse files

Merge "Make folder stack more vertical for LMP preview" into ub-now-nova

parents a629f268 8edd2001
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -73,6 +73,8 @@ public class FolderIcon extends FrameLayout implements FolderListener {
    // The amount of vertical spread between items in the stack [0...1]
    private static final float PERSPECTIVE_SHIFT_FACTOR = 0.24f;

    private static final float PERSPECTIVE_SHIFT_FACTOR_L = 0.18f;

    // Flag as to whether or not to draw an outer ring. Currently none is designed.
    public static final boolean HAS_OUTER_RING = true;

@@ -501,10 +503,16 @@ public class FolderIcon extends FrameLayout implements FolderListener {
            int adjustedAvailableSpace = (int) ((mAvailableSpaceInPreview / 2) * (1 + 0.8f));

            int unscaledHeight = (int) (mIntrinsicIconSize * (1 + PERSPECTIVE_SHIFT_FACTOR));
            if (Utilities.isLmp()) {
                unscaledHeight = (int) (mIntrinsicIconSize * (1 + PERSPECTIVE_SHIFT_FACTOR_L));
            }
            mBaselineIconScale = (1.0f * adjustedAvailableSpace / unscaledHeight);

            mBaselineIconSize = (int) (mIntrinsicIconSize * mBaselineIconScale);
            mMaxPerspectiveShift = mBaselineIconSize * PERSPECTIVE_SHIFT_FACTOR;
            if (Utilities.isLmp()) {
                mMaxPerspectiveShift = mBaselineIconSize * PERSPECTIVE_SHIFT_FACTOR_L;
            }

            mPreviewOffsetX = (mTotalWidth - mAvailableSpaceInPreview) / 2;
            mPreviewOffsetY = previewPadding + grid.folderBackgroundOffset;
@@ -559,6 +567,10 @@ public class FolderIcon extends FrameLayout implements FolderListener {
        float totalScale = mBaselineIconScale * scale;
        final int overlayAlpha = (int) (80 * (1 - r));

        if (Utilities.isLmp()) {
            transX = (mAvailableSpaceInPreview - scaledSize) / 2;
        }

        if (params == null) {
            params = new PreviewItemDrawingParams(transX, transY, totalScale, overlayAlpha);
        } else {