Loading res/values/attrs.xml +0 −12 Original line number Diff line number Diff line Loading @@ -164,19 +164,7 @@ <!-- numFolderRows & numFolderColumns defaults to numRows & numColumns, if not specified --> <attr name="numFolderRows" format="integer" /> <!-- defaults to numFolderRows, if not specified --> <attr name="numFolderRowsLandscape" format="integer" /> <!-- defaults to numFolderRows, if not specified --> <attr name="numFolderRowsTwoPanelLandscape" format="integer" /> <!-- defaults to numFolderRows, if not specified --> <attr name="numFolderRowsTwoPanelPortrait" format="integer" /> <attr name="numFolderColumns" format="integer" /> <!-- defaults to numFolderColumns, if not specified --> <attr name="numFolderColumnsLandscape" format="integer" /> <!-- defaults to numFolderColumns, if not specified --> <attr name="numFolderColumnsTwoPanelLandscape" format="integer" /> <!-- defaults to numFolderColumns, if not specified --> <attr name="numFolderColumnsTwoPanelPortrait" format="integer" /> <!-- Support attributes in FolderStyle --> <attr name="folderStyle" format="reference" /> Loading src/com/android/launcher3/DeviceProfile.java +8 −12 Original line number Diff line number Diff line Loading @@ -182,8 +182,6 @@ public class DeviceProfile { public int cellYPaddingPx = -1; // Folder public final int numFolderRows; public final int numFolderColumns; public final float folderLabelTextScale; public int folderLabelTextSizePx; public int folderFooterHeightPx; Loading Loading @@ -441,8 +439,6 @@ public class DeviceProfile { } folderLabelTextScale = res.getFloat(R.dimen.folder_label_text_scale); numFolderRows = inv.numFolderRows[mTypeIndex]; numFolderColumns = inv.numFolderColumns[mTypeIndex]; if (mIsScalableGrid && inv.folderStyle != INVALID_RESOURCE_HANDLE) { TypedArray folderStyle = context.obtainStyledAttributes(inv.folderStyle, Loading Loading @@ -649,11 +645,11 @@ public class DeviceProfile { isTwoPanels ? inv.folderSpecsTwoPanelId : inv.folderSpecsId), ResponsiveSpecType.Folder); mResponsiveFolderWidthSpec = folderSpecs.getCalculatedSpec(responsiveAspectRatio, DimensionType.WIDTH, numFolderColumns, DimensionType.WIDTH, inv.numFolderColumns, mResponsiveWorkspaceWidthSpec.getAvailableSpace(), mResponsiveWorkspaceWidthSpec); mResponsiveFolderHeightSpec = folderSpecs.getCalculatedSpec(responsiveAspectRatio, DimensionType.HEIGHT, numFolderRows, DimensionType.HEIGHT, inv.numFolderRows, mResponsiveWorkspaceHeightSpec.getAvailableSpace(), mResponsiveWorkspaceHeightSpec); Loading Loading @@ -1410,16 +1406,16 @@ public class DeviceProfile { Point totalWorkspacePadding = getTotalWorkspacePadding(); // Check if the folder fit within the available height. float contentUsedHeight = folderCellHeightPx * numFolderRows + ((numFolderRows - 1) * folderCellLayoutBorderSpacePx.y) float contentUsedHeight = folderCellHeightPx * inv.numFolderRows + ((inv.numFolderRows - 1) * folderCellLayoutBorderSpacePx.y) + folderFooterHeightPx + folderContentPaddingTop; int contentMaxHeight = availableHeightPx - totalWorkspacePadding.y; float scaleY = contentMaxHeight / contentUsedHeight; // Check if the folder fit within the available width. float contentUsedWidth = folderCellWidthPx * numFolderColumns + ((numFolderColumns - 1) * folderCellLayoutBorderSpacePx.x) float contentUsedWidth = folderCellWidthPx * inv.numFolderColumns + ((inv.numFolderColumns - 1) * folderCellLayoutBorderSpacePx.x) + folderContentPaddingLeftRight * 2; int contentMaxWidth = availableWidthPx - totalWorkspacePadding.x; float scaleX = contentMaxWidth / contentUsedWidth; Loading Loading @@ -2049,8 +2045,8 @@ public class DeviceProfile { writer.println(prefix + pxToDpStr("iconTextSizePx", iconTextSizePx)); writer.println(prefix + pxToDpStr("iconDrawablePaddingPx", iconDrawablePaddingPx)); writer.println(prefix + "\tnumFolderRows: " + numFolderRows); writer.println(prefix + "\tnumFolderColumns: " + numFolderColumns); writer.println(prefix + "\tinv.numFolderRows: " + inv.numFolderRows); writer.println(prefix + "\tinv.numFolderColumns: " + inv.numFolderColumns); writer.println(prefix + pxToDpStr("folderCellWidthPx", folderCellWidthPx)); writer.println(prefix + pxToDpStr("folderCellHeightPx", folderCellHeightPx)); writer.println(prefix + pxToDpStr("folderChildIconSizePx", folderChildIconSizePx)); Loading src/com/android/launcher3/InvariantDeviceProfile.java +6 −34 Original line number Diff line number Diff line Loading @@ -122,8 +122,8 @@ public class InvariantDeviceProfile { /** * Number of icons per row and column in the folder. */ public int[] numFolderRows; public int[] numFolderColumns; public int numFolderRows; public int numFolderColumns; public float[] iconSize; public float[] iconTextSize; public int iconBitmapSize; Loading Loading @@ -810,8 +810,8 @@ public class InvariantDeviceProfile { public final int numSearchContainerColumns; public final int deviceCategory; private final int[] numFolderRows = new int[COUNT_SIZES]; private final int[] numFolderColumns = new int[COUNT_SIZES]; private final int numFolderRows; private final int numFolderColumns; private final @StyleRes int folderStyle; private final @StyleRes int cellStyle; Loading Loading @@ -888,39 +888,11 @@ public class InvariantDeviceProfile { a.getResourceId(R.styleable.GridDisplayOption_inlineNavButtonsEndSpacing, R.dimen.taskbar_button_margin_default); numFolderRows[INDEX_DEFAULT] = a.getInt( numFolderRows = a.getInt( R.styleable.GridDisplayOption_numFolderRows, numRows); numFolderColumns[INDEX_DEFAULT] = a.getInt( numFolderColumns = a.getInt( R.styleable.GridDisplayOption_numFolderColumns, numColumns); if (FeatureFlags.enableResponsiveWorkspace()) { numFolderRows[INDEX_LANDSCAPE] = a.getInt( R.styleable.GridDisplayOption_numFolderRowsLandscape, numFolderRows[INDEX_DEFAULT]); numFolderColumns[INDEX_LANDSCAPE] = a.getInt( R.styleable.GridDisplayOption_numFolderColumnsLandscape, numFolderColumns[INDEX_DEFAULT]); numFolderRows[INDEX_TWO_PANEL_PORTRAIT] = a.getInt( R.styleable.GridDisplayOption_numFolderRowsTwoPanelPortrait, numFolderRows[INDEX_DEFAULT]); numFolderColumns[INDEX_TWO_PANEL_PORTRAIT] = a.getInt( R.styleable.GridDisplayOption_numFolderColumnsTwoPanelPortrait, numFolderColumns[INDEX_DEFAULT]); numFolderRows[INDEX_TWO_PANEL_LANDSCAPE] = a.getInt( R.styleable.GridDisplayOption_numFolderRowsTwoPanelLandscape, numFolderRows[INDEX_DEFAULT]); numFolderColumns[INDEX_TWO_PANEL_LANDSCAPE] = a.getInt( R.styleable.GridDisplayOption_numFolderColumnsTwoPanelLandscape, numFolderColumns[INDEX_DEFAULT]); } else { numFolderRows[INDEX_LANDSCAPE] = numFolderRows[INDEX_DEFAULT]; numFolderColumns[INDEX_LANDSCAPE] = numFolderColumns[INDEX_DEFAULT]; numFolderRows[INDEX_TWO_PANEL_PORTRAIT] = numFolderRows[INDEX_DEFAULT]; numFolderColumns[INDEX_TWO_PANEL_PORTRAIT] = numFolderColumns[INDEX_DEFAULT]; numFolderRows[INDEX_TWO_PANEL_LANDSCAPE] = numFolderRows[INDEX_DEFAULT]; numFolderColumns[INDEX_TWO_PANEL_LANDSCAPE] = numFolderColumns[INDEX_DEFAULT]; } folderStyle = a.getResourceId(R.styleable.GridDisplayOption_folderStyle, INVALID_RESOURCE_HANDLE); Loading src/com/android/launcher3/Launcher.java +2 −2 Original line number Diff line number Diff line Loading @@ -804,7 +804,7 @@ public class Launcher extends StatefulActivity<LauncherState> if (info.container >= 0) { View folderIcon = getWorkspace().getHomescreenIconByItemId(info.container); if (folderIcon instanceof FolderIcon && folderIcon.getTag() instanceof FolderInfo) { if (new FolderGridOrganizer(getDeviceProfile()) if (new FolderGridOrganizer(getDeviceProfile().inv) .setFolderInfo((FolderInfo) folderIcon.getTag()) .isItemInPreview(info.rank)) { folderIcon.invalidate(); Loading Loading @@ -2661,7 +2661,7 @@ public class Launcher extends StatefulActivity<LauncherState> // Cache one page worth of icons getViewCache().setCacheSize(R.layout.folder_application, mDeviceProfile.numFolderColumns * mDeviceProfile.numFolderRows); mDeviceProfile.inv.numFolderColumns * mDeviceProfile.inv.numFolderRows); getViewCache().setCacheSize(R.layout.folder_page, 2); TraceHelper.INSTANCE.endSection(); Loading src/com/android/launcher3/folder/Folder.java +2 −2 Original line number Diff line number Diff line Loading @@ -1082,7 +1082,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo private void updateItemLocationsInDatabaseBatch(boolean isBind) { FolderGridOrganizer verifier = new FolderGridOrganizer( mActivityContext.getDeviceProfile()).setFolderInfo(mInfo); mActivityContext.getDeviceProfile().inv).setFolderInfo(mInfo); ArrayList<ItemInfo> items = new ArrayList<>(); int total = mInfo.contents.size(); Loading Loading @@ -1381,7 +1381,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo @Override public void onAdd(WorkspaceItemInfo item, int rank) { FolderGridOrganizer verifier = new FolderGridOrganizer( mActivityContext.getDeviceProfile()).setFolderInfo(mInfo); mActivityContext.getDeviceProfile().inv).setFolderInfo(mInfo); verifier.updateRankAndPos(item, rank); mLauncherDelegate.getModelWriter().addOrMoveItemInDatabase(item, mInfo.id, 0, item.cellX, item.cellY); Loading Loading
res/values/attrs.xml +0 −12 Original line number Diff line number Diff line Loading @@ -164,19 +164,7 @@ <!-- numFolderRows & numFolderColumns defaults to numRows & numColumns, if not specified --> <attr name="numFolderRows" format="integer" /> <!-- defaults to numFolderRows, if not specified --> <attr name="numFolderRowsLandscape" format="integer" /> <!-- defaults to numFolderRows, if not specified --> <attr name="numFolderRowsTwoPanelLandscape" format="integer" /> <!-- defaults to numFolderRows, if not specified --> <attr name="numFolderRowsTwoPanelPortrait" format="integer" /> <attr name="numFolderColumns" format="integer" /> <!-- defaults to numFolderColumns, if not specified --> <attr name="numFolderColumnsLandscape" format="integer" /> <!-- defaults to numFolderColumns, if not specified --> <attr name="numFolderColumnsTwoPanelLandscape" format="integer" /> <!-- defaults to numFolderColumns, if not specified --> <attr name="numFolderColumnsTwoPanelPortrait" format="integer" /> <!-- Support attributes in FolderStyle --> <attr name="folderStyle" format="reference" /> Loading
src/com/android/launcher3/DeviceProfile.java +8 −12 Original line number Diff line number Diff line Loading @@ -182,8 +182,6 @@ public class DeviceProfile { public int cellYPaddingPx = -1; // Folder public final int numFolderRows; public final int numFolderColumns; public final float folderLabelTextScale; public int folderLabelTextSizePx; public int folderFooterHeightPx; Loading Loading @@ -441,8 +439,6 @@ public class DeviceProfile { } folderLabelTextScale = res.getFloat(R.dimen.folder_label_text_scale); numFolderRows = inv.numFolderRows[mTypeIndex]; numFolderColumns = inv.numFolderColumns[mTypeIndex]; if (mIsScalableGrid && inv.folderStyle != INVALID_RESOURCE_HANDLE) { TypedArray folderStyle = context.obtainStyledAttributes(inv.folderStyle, Loading Loading @@ -649,11 +645,11 @@ public class DeviceProfile { isTwoPanels ? inv.folderSpecsTwoPanelId : inv.folderSpecsId), ResponsiveSpecType.Folder); mResponsiveFolderWidthSpec = folderSpecs.getCalculatedSpec(responsiveAspectRatio, DimensionType.WIDTH, numFolderColumns, DimensionType.WIDTH, inv.numFolderColumns, mResponsiveWorkspaceWidthSpec.getAvailableSpace(), mResponsiveWorkspaceWidthSpec); mResponsiveFolderHeightSpec = folderSpecs.getCalculatedSpec(responsiveAspectRatio, DimensionType.HEIGHT, numFolderRows, DimensionType.HEIGHT, inv.numFolderRows, mResponsiveWorkspaceHeightSpec.getAvailableSpace(), mResponsiveWorkspaceHeightSpec); Loading Loading @@ -1410,16 +1406,16 @@ public class DeviceProfile { Point totalWorkspacePadding = getTotalWorkspacePadding(); // Check if the folder fit within the available height. float contentUsedHeight = folderCellHeightPx * numFolderRows + ((numFolderRows - 1) * folderCellLayoutBorderSpacePx.y) float contentUsedHeight = folderCellHeightPx * inv.numFolderRows + ((inv.numFolderRows - 1) * folderCellLayoutBorderSpacePx.y) + folderFooterHeightPx + folderContentPaddingTop; int contentMaxHeight = availableHeightPx - totalWorkspacePadding.y; float scaleY = contentMaxHeight / contentUsedHeight; // Check if the folder fit within the available width. float contentUsedWidth = folderCellWidthPx * numFolderColumns + ((numFolderColumns - 1) * folderCellLayoutBorderSpacePx.x) float contentUsedWidth = folderCellWidthPx * inv.numFolderColumns + ((inv.numFolderColumns - 1) * folderCellLayoutBorderSpacePx.x) + folderContentPaddingLeftRight * 2; int contentMaxWidth = availableWidthPx - totalWorkspacePadding.x; float scaleX = contentMaxWidth / contentUsedWidth; Loading Loading @@ -2049,8 +2045,8 @@ public class DeviceProfile { writer.println(prefix + pxToDpStr("iconTextSizePx", iconTextSizePx)); writer.println(prefix + pxToDpStr("iconDrawablePaddingPx", iconDrawablePaddingPx)); writer.println(prefix + "\tnumFolderRows: " + numFolderRows); writer.println(prefix + "\tnumFolderColumns: " + numFolderColumns); writer.println(prefix + "\tinv.numFolderRows: " + inv.numFolderRows); writer.println(prefix + "\tinv.numFolderColumns: " + inv.numFolderColumns); writer.println(prefix + pxToDpStr("folderCellWidthPx", folderCellWidthPx)); writer.println(prefix + pxToDpStr("folderCellHeightPx", folderCellHeightPx)); writer.println(prefix + pxToDpStr("folderChildIconSizePx", folderChildIconSizePx)); Loading
src/com/android/launcher3/InvariantDeviceProfile.java +6 −34 Original line number Diff line number Diff line Loading @@ -122,8 +122,8 @@ public class InvariantDeviceProfile { /** * Number of icons per row and column in the folder. */ public int[] numFolderRows; public int[] numFolderColumns; public int numFolderRows; public int numFolderColumns; public float[] iconSize; public float[] iconTextSize; public int iconBitmapSize; Loading Loading @@ -810,8 +810,8 @@ public class InvariantDeviceProfile { public final int numSearchContainerColumns; public final int deviceCategory; private final int[] numFolderRows = new int[COUNT_SIZES]; private final int[] numFolderColumns = new int[COUNT_SIZES]; private final int numFolderRows; private final int numFolderColumns; private final @StyleRes int folderStyle; private final @StyleRes int cellStyle; Loading Loading @@ -888,39 +888,11 @@ public class InvariantDeviceProfile { a.getResourceId(R.styleable.GridDisplayOption_inlineNavButtonsEndSpacing, R.dimen.taskbar_button_margin_default); numFolderRows[INDEX_DEFAULT] = a.getInt( numFolderRows = a.getInt( R.styleable.GridDisplayOption_numFolderRows, numRows); numFolderColumns[INDEX_DEFAULT] = a.getInt( numFolderColumns = a.getInt( R.styleable.GridDisplayOption_numFolderColumns, numColumns); if (FeatureFlags.enableResponsiveWorkspace()) { numFolderRows[INDEX_LANDSCAPE] = a.getInt( R.styleable.GridDisplayOption_numFolderRowsLandscape, numFolderRows[INDEX_DEFAULT]); numFolderColumns[INDEX_LANDSCAPE] = a.getInt( R.styleable.GridDisplayOption_numFolderColumnsLandscape, numFolderColumns[INDEX_DEFAULT]); numFolderRows[INDEX_TWO_PANEL_PORTRAIT] = a.getInt( R.styleable.GridDisplayOption_numFolderRowsTwoPanelPortrait, numFolderRows[INDEX_DEFAULT]); numFolderColumns[INDEX_TWO_PANEL_PORTRAIT] = a.getInt( R.styleable.GridDisplayOption_numFolderColumnsTwoPanelPortrait, numFolderColumns[INDEX_DEFAULT]); numFolderRows[INDEX_TWO_PANEL_LANDSCAPE] = a.getInt( R.styleable.GridDisplayOption_numFolderRowsTwoPanelLandscape, numFolderRows[INDEX_DEFAULT]); numFolderColumns[INDEX_TWO_PANEL_LANDSCAPE] = a.getInt( R.styleable.GridDisplayOption_numFolderColumnsTwoPanelLandscape, numFolderColumns[INDEX_DEFAULT]); } else { numFolderRows[INDEX_LANDSCAPE] = numFolderRows[INDEX_DEFAULT]; numFolderColumns[INDEX_LANDSCAPE] = numFolderColumns[INDEX_DEFAULT]; numFolderRows[INDEX_TWO_PANEL_PORTRAIT] = numFolderRows[INDEX_DEFAULT]; numFolderColumns[INDEX_TWO_PANEL_PORTRAIT] = numFolderColumns[INDEX_DEFAULT]; numFolderRows[INDEX_TWO_PANEL_LANDSCAPE] = numFolderRows[INDEX_DEFAULT]; numFolderColumns[INDEX_TWO_PANEL_LANDSCAPE] = numFolderColumns[INDEX_DEFAULT]; } folderStyle = a.getResourceId(R.styleable.GridDisplayOption_folderStyle, INVALID_RESOURCE_HANDLE); Loading
src/com/android/launcher3/Launcher.java +2 −2 Original line number Diff line number Diff line Loading @@ -804,7 +804,7 @@ public class Launcher extends StatefulActivity<LauncherState> if (info.container >= 0) { View folderIcon = getWorkspace().getHomescreenIconByItemId(info.container); if (folderIcon instanceof FolderIcon && folderIcon.getTag() instanceof FolderInfo) { if (new FolderGridOrganizer(getDeviceProfile()) if (new FolderGridOrganizer(getDeviceProfile().inv) .setFolderInfo((FolderInfo) folderIcon.getTag()) .isItemInPreview(info.rank)) { folderIcon.invalidate(); Loading Loading @@ -2661,7 +2661,7 @@ public class Launcher extends StatefulActivity<LauncherState> // Cache one page worth of icons getViewCache().setCacheSize(R.layout.folder_application, mDeviceProfile.numFolderColumns * mDeviceProfile.numFolderRows); mDeviceProfile.inv.numFolderColumns * mDeviceProfile.inv.numFolderRows); getViewCache().setCacheSize(R.layout.folder_page, 2); TraceHelper.INSTANCE.endSection(); Loading
src/com/android/launcher3/folder/Folder.java +2 −2 Original line number Diff line number Diff line Loading @@ -1082,7 +1082,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo private void updateItemLocationsInDatabaseBatch(boolean isBind) { FolderGridOrganizer verifier = new FolderGridOrganizer( mActivityContext.getDeviceProfile()).setFolderInfo(mInfo); mActivityContext.getDeviceProfile().inv).setFolderInfo(mInfo); ArrayList<ItemInfo> items = new ArrayList<>(); int total = mInfo.contents.size(); Loading Loading @@ -1381,7 +1381,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo @Override public void onAdd(WorkspaceItemInfo item, int rank) { FolderGridOrganizer verifier = new FolderGridOrganizer( mActivityContext.getDeviceProfile()).setFolderInfo(mInfo); mActivityContext.getDeviceProfile().inv).setFolderInfo(mInfo); verifier.updateRankAndPos(item, rank); mLauncherDelegate.getModelWriter().addOrMoveItemInDatabase(item, mInfo.id, 0, item.cellX, item.cellY); Loading