Revert "Update Folders to match spec."

This reverts commit fd8fa136f5.

Change-Id: Ifb8ce81e23f38df2eb2c26f93376eca19caae5b1
This commit is contained in:
Jonathan Miranda 2017-07-26 17:41:02 +00:00 committed by Jon Miranda
parent df4aaca594
commit 9ad87463a8
4 changed files with 10 additions and 23 deletions

View File

@ -19,9 +19,4 @@
xmlns:launcher="http://schemas.android.com/apk/res-auto"
style="@style/BaseIcon"
android:includeFontPadding="false"
android:paddingLeft="@dimen/folder_cell_x_padding"
android:paddingTop="@dimen/folder_cell_y_padding"
android:paddingRight="@dimen/folder_cell_x_padding"
android:paddingBottom="@dimen/folder_cell_y_padding"
launcher:centerVertically="true"
launcher:iconDisplay="folder"/>
launcher:iconDisplay="folder" />

View File

@ -138,11 +138,10 @@
<dimen name="folder_preview_padding">10dp</dimen>
<dimen name="page_indicator_dot_size">8dp</dimen>
<dimen name="folder_cell_x_padding">8dp</dimen>
<dimen name="folder_cell_y_padding">8dp</dimen>
<dimen name="folder_cell_x_padding">9dp</dimen>
<dimen name="folder_cell_y_padding">6dp</dimen>
<dimen name="folder_child_text_size">13sp</dimen>
<dimen name="folder_child_icon_drawable_padding">8dp</dimen>
<dimen name="folder_label_padding_top">12dp</dimen>
<dimen name="folder_label_padding_top">4dp</dimen>
<dimen name="folder_label_padding_bottom">12dp</dimen>
<dimen name="folder_label_text_size">14sp</dimen>

View File

@ -108,7 +108,6 @@ public class DeviceProfile {
public int folderChildIconSizePx;
public int folderChildTextSizePx;
public int folderChildDrawablePaddingPx;
public final int folderChildDrawablePaddingOriginalPx;
// Hotseat
public int hotseatCellHeightPx;
@ -221,9 +220,6 @@ public class DeviceProfile {
hotseatLandRightNavBarGutterPx = res.getDimensionPixelSize(
R.dimen.dynamic_grid_hotseat_land_right_nav_bar_gutter_width);
folderChildDrawablePaddingOriginalPx =
res.getDimensionPixelSize(R.dimen.folder_child_icon_drawable_padding);
// Determine sizes.
widthPx = width;
heightPx = height;
@ -403,15 +399,15 @@ public class DeviceProfile {
folderChildIconSizePx = (int) (Utilities.pxFromDp(inv.iconSize, dm) * scale);
folderChildTextSizePx =
(int) (res.getDimensionPixelSize(R.dimen.folder_child_text_size) * scale);
folderChildDrawablePaddingPx = (int) (folderChildDrawablePaddingOriginalPx * scale);
int textHeight = Utilities.calculateTextHeight(folderChildTextSizePx);
int cellPaddingX = (int) (res.getDimensionPixelSize(R.dimen.folder_cell_x_padding) * scale);
int cellPaddingY = (int) (res.getDimensionPixelSize(R.dimen.folder_cell_y_padding) * scale);
folderCellWidthPx = folderChildIconSizePx + 2 * cellPaddingX;
folderCellHeightPx = folderChildIconSizePx + 2 * cellPaddingY + textHeight
+ folderChildDrawablePaddingPx;
folderCellHeightPx = folderChildIconSizePx + 2 * cellPaddingY + textHeight;
folderChildDrawablePaddingPx = Math.max(0,
(folderCellHeightPx - folderChildIconSizePx - textHeight) / 3);
}
public void updateInsets(Rect insets) {

View File

@ -120,7 +120,6 @@ public class FolderAnimationManager {
final DragLayer.LayoutParams lp = (DragLayer.LayoutParams) mFolder.getLayoutParams();
FolderIcon.PreviewLayoutRule rule = mFolderIcon.getLayoutRule();
final List<BubbleTextView> itemsInPreview = mFolderIcon.getPreviewItems();
BubbleTextView btv = itemsInPreview.get(0);
// Match position of the FolderIcon
final Rect folderIconPos = new Rect();
@ -132,7 +131,7 @@ public class FolderAnimationManager {
// Match size/scale of icons in the preview
float previewScale = rule.scaleForItem(0, itemsInPreview.size());
float previewSize = rule.getIconSize() * previewScale;
float initialScale = previewSize / btv.getIconSize()
float initialScale = previewSize / itemsInPreview.get(0).getIconSize()
* scaleRelativeToDragLayer;
final float finalScale = 1f;
float scale = mIsOpening ? initialScale : finalScale;
@ -149,12 +148,10 @@ public class FolderAnimationManager {
previewItemOffsetX = (int) (lp.width * initialScale - initialSize - previewItemOffsetX);
}
// Note that we do not include btv.getPaddingLeft() in the calculation, since it is
// handled in addPreviewItemAnimators as part of iconOffsetX.
final int paddingOffsetX = (int) ((mFolder.getPaddingLeft() + mContent.getPaddingLeft())
* initialScale);
final int paddingOffsetY = (int) ((mFolder.getPaddingTop() + mContent.getPaddingTop()
+ btv.getPaddingTop()) * initialScale);
final int paddingOffsetY = (int) ((mFolder.getPaddingTop() + mContent.getPaddingTop())
* initialScale);
int initialX = folderIconPos.left + mPreviewBackground.getOffsetX() - paddingOffsetX
- previewItemOffsetX;