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

Commit f7106648 authored by Tony Wickham's avatar Tony Wickham Committed by Android (Google) Code Review
Browse files

Merge "Center folders slightly less aggressively than before" into ub-launcher3-calgary

parents ef0ac88e 82fa9201
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1067,8 +1067,13 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
                sTempRect.left + sTempRect.width() - width);
        int top = Math.min(Math.max(sTempRect.top, centeredTop),
                sTempRect.top + sTempRect.height() - height);
        if (grid.isPhone && (grid.availableWidthPx - width) < grid.iconSizePx) {
            // Center the folder if it is full (on phones only)

        int distFromEdgeOfScreen = grid.getWorkspacePadding(isLayoutRtl()).left + getPaddingLeft();

        if (grid.isPhone && (grid.availableWidthPx - width) < 4 * distFromEdgeOfScreen) {
            // Center the folder if it is very close to being centered anyway, by virtue of
            // filling the majority of the viewport. ie. remove it from the uncanny valley
            // of centeredness.
            left = (grid.availableWidthPx - width) / 2;
        } else if (width >= sTempRect.width()) {
            // If the folder doesn't fit within the bounds, center it about the desired bounds