mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Merge "Polish folder icon bugs." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
835fab2305
@@ -684,9 +684,6 @@ public class CellLayout extends ViewGroup {
|
||||
if (child instanceof BubbleTextView) {
|
||||
BubbleTextView bubbleChild = (BubbleTextView) child;
|
||||
bubbleChild.setTextVisibility(mContainerType != HOTSEAT);
|
||||
if (mActivity.getDeviceProfile().isScalableGrid) {
|
||||
bubbleChild.setCenterVertically(mContainerType != HOTSEAT);
|
||||
}
|
||||
}
|
||||
|
||||
child.setScaleX(mChildScale);
|
||||
|
||||
@@ -138,12 +138,14 @@ public class ShortcutAndWidgetContainer extends ViewGroup implements FolderIcon.
|
||||
mBorderSpacing, null);
|
||||
// Center the icon/folder
|
||||
int cHeight = getCellContentHeight();
|
||||
int cellPaddingY = (int) Math.max(0, ((lp.height - cHeight) / 2f));
|
||||
int cellPaddingY = dp.isScalableGrid && mContainerType == WORKSPACE
|
||||
? dp.cellYPaddingPx
|
||||
: (int) Math.max(0, ((lp.height - cHeight) / 2f));
|
||||
|
||||
// No need to add padding when cell layout border spacing is present.
|
||||
boolean noPadding = (dp.cellLayoutBorderSpacingPx > 0 && mContainerType == WORKSPACE)
|
||||
boolean noPaddingX = (dp.cellLayoutBorderSpacingPx > 0 && mContainerType == WORKSPACE)
|
||||
|| (dp.folderCellLayoutBorderSpacingPx > 0 && mContainerType == FOLDER);
|
||||
int cellPaddingX = noPadding
|
||||
int cellPaddingX = noPaddingX
|
||||
? 0
|
||||
: mContainerType == WORKSPACE
|
||||
? dp.workspaceCellPaddingXPx
|
||||
|
||||
@@ -245,9 +245,8 @@ public class FolderAnimationManager {
|
||||
+ mDeviceProfile.folderCellHeightPx * 2;
|
||||
int page = mIsOpening ? mContent.getCurrentPage() : mContent.getDestinationPage();
|
||||
int left = mContent.getPaddingLeft() + page * lp.width;
|
||||
Rect contentStart = new Rect(0, 0, width, height);
|
||||
Rect contentEnd = new Rect(endRect.left + left, endRect.top, endRect.right + left,
|
||||
endRect.bottom);
|
||||
Rect contentStart = new Rect(left, 0, left + width, height);
|
||||
Rect contentEnd = new Rect(left, 0, left + lp.width, lp.height);
|
||||
play(a, getShape().createRevealAnimator(
|
||||
mFolder.getContent(), contentStart, contentEnd, finalRadius, !mIsOpening));
|
||||
|
||||
|
||||
@@ -174,8 +174,6 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel
|
||||
folder.setFolderIcon(icon);
|
||||
folder.bind(folderInfo);
|
||||
icon.setFolder(folder);
|
||||
icon.mBackground.paddingY = icon.isInHotseat()
|
||||
? 0 : activityContext.getDeviceProfile().cellYPaddingPx;
|
||||
return icon;
|
||||
}
|
||||
|
||||
@@ -217,7 +215,6 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel
|
||||
|
||||
icon.setAccessibilityDelegate(activity.getAccessibilityDelegate());
|
||||
|
||||
icon.mBackground.paddingY = icon.isInHotseat() ? 0 : grid.cellYPaddingPx;
|
||||
icon.mPreviewVerifier = new FolderGridOrganizer(activity.getDeviceProfile().inv);
|
||||
icon.mPreviewVerifier.setFolderInfo(folderInfo);
|
||||
icon.updatePreviewItems(false);
|
||||
@@ -580,7 +577,6 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel
|
||||
public void setFolderBackground(PreviewBackground bg) {
|
||||
mBackground = bg;
|
||||
mBackground.setInvalidateDelegate(this);
|
||||
mBackground.paddingY = isInHotseat() ? 0 : mActivity.getDeviceProfile().cellYPaddingPx;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -628,7 +624,6 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel
|
||||
if (!mForceHideDot && ((mDotInfo != null && mDotInfo.hasDot()) || mDotScale > 0)) {
|
||||
Rect iconBounds = mDotParams.iconBounds;
|
||||
BubbleTextView.getIconBounds(this, iconBounds, mActivity.getDeviceProfile().iconSizePx);
|
||||
iconBounds.offset(0, mBackground.paddingY);
|
||||
float iconScale = (float) mBackground.previewSize / iconBounds.width();
|
||||
Utilities.scaleRectAboutCenter(iconBounds, iconScale);
|
||||
|
||||
|
||||
@@ -77,7 +77,6 @@ public class PreviewBackground extends CellLayout.DelegatedCellDrawing {
|
||||
int previewSize;
|
||||
int basePreviewOffsetX;
|
||||
int basePreviewOffsetY;
|
||||
int paddingY;
|
||||
|
||||
private CellLayout mDrawingDelegate;
|
||||
|
||||
@@ -161,7 +160,7 @@ public class PreviewBackground extends CellLayout.DelegatedCellDrawing {
|
||||
previewSize = grid.folderIconSizePx;
|
||||
|
||||
basePreviewOffsetX = (availableSpaceX - previewSize) / 2;
|
||||
basePreviewOffsetY = paddingY + topPadding + grid.folderIconOffsetYPx;
|
||||
basePreviewOffsetY = topPadding + grid.folderIconOffsetYPx;
|
||||
|
||||
// Stroke width is 1dp
|
||||
mStrokeWidth = context.getResources().getDisplayMetrics().density;
|
||||
|
||||
Reference in New Issue
Block a user