Loading src/com/android/launcher3/CellLayout.java +35 −17 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ public class CellLayout extends ViewGroup { private int mFixedCellWidth; private int mFixedCellHeight; @ViewDebug.ExportedProperty(category = "launcher") private final Point mBorderSpace; private Point mBorderSpace; @ViewDebug.ExportedProperty(category = "launcher") private int mCountX; Loading Loading @@ -239,22 +239,7 @@ public class CellLayout extends ViewGroup { mActivity = ActivityContext.lookupContext(context); DeviceProfile deviceProfile = mActivity.getDeviceProfile(); switch (mContainerType) { case FOLDER: mBorderSpace = new Point(deviceProfile.folderCellLayoutBorderSpacePx); break; case HOTSEAT: mBorderSpace = new Point(deviceProfile.hotseatBorderSpace, deviceProfile.hotseatBorderSpace); break; case WORKSPACE: default: mBorderSpace = new Point(deviceProfile.cellLayoutBorderSpacePx); break; } mCellWidth = mCellHeight = -1; mFixedCellWidth = mFixedCellHeight = -1; resetCellSizeInternal(deviceProfile); mCountX = deviceProfile.inv.numColumns; mCountY = deviceProfile.inv.numRows; Loading Loading @@ -379,6 +364,12 @@ public class CellLayout extends ViewGroup { return mShortcutsAndWidgets.getLayerType() == LAYER_TYPE_HARDWARE; } /** * Change sizes of cells * * @param width the new width of the cells * @param height the new height of the cells */ public void setCellDimensions(int width, int height) { mFixedCellWidth = mCellWidth = width; mFixedCellHeight = mCellHeight = height; Loading @@ -386,6 +377,33 @@ public class CellLayout extends ViewGroup { mBorderSpace); } private void resetCellSizeInternal(DeviceProfile deviceProfile) { switch (mContainerType) { case FOLDER: mBorderSpace = new Point(deviceProfile.folderCellLayoutBorderSpacePx); break; case HOTSEAT: mBorderSpace = new Point(deviceProfile.hotseatBorderSpace, deviceProfile.hotseatBorderSpace); break; case WORKSPACE: default: mBorderSpace = new Point(deviceProfile.cellLayoutBorderSpacePx); break; } mCellWidth = mCellHeight = -1; mFixedCellWidth = mFixedCellHeight = -1; } /** * Reset the cell sizes and border space */ public void resetCellSize(DeviceProfile deviceProfile) { resetCellSizeInternal(deviceProfile); requestLayout(); } public void setGridSize(int x, int y) { mCountX = x; mCountY = y; Loading src/com/android/launcher3/Hotseat.java +1 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ public class Hotseat extends CellLayout implements Insettable { removeAllViewsInLayout(); mHasVerticalHotseat = hasVerticalHotseat; DeviceProfile dp = mActivity.getDeviceProfile(); resetCellSize(dp); if (hasVerticalHotseat) { setGridSize(1, dp.numShownHotseatIcons); } else { Loading Loading
src/com/android/launcher3/CellLayout.java +35 −17 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ public class CellLayout extends ViewGroup { private int mFixedCellWidth; private int mFixedCellHeight; @ViewDebug.ExportedProperty(category = "launcher") private final Point mBorderSpace; private Point mBorderSpace; @ViewDebug.ExportedProperty(category = "launcher") private int mCountX; Loading Loading @@ -239,22 +239,7 @@ public class CellLayout extends ViewGroup { mActivity = ActivityContext.lookupContext(context); DeviceProfile deviceProfile = mActivity.getDeviceProfile(); switch (mContainerType) { case FOLDER: mBorderSpace = new Point(deviceProfile.folderCellLayoutBorderSpacePx); break; case HOTSEAT: mBorderSpace = new Point(deviceProfile.hotseatBorderSpace, deviceProfile.hotseatBorderSpace); break; case WORKSPACE: default: mBorderSpace = new Point(deviceProfile.cellLayoutBorderSpacePx); break; } mCellWidth = mCellHeight = -1; mFixedCellWidth = mFixedCellHeight = -1; resetCellSizeInternal(deviceProfile); mCountX = deviceProfile.inv.numColumns; mCountY = deviceProfile.inv.numRows; Loading Loading @@ -379,6 +364,12 @@ public class CellLayout extends ViewGroup { return mShortcutsAndWidgets.getLayerType() == LAYER_TYPE_HARDWARE; } /** * Change sizes of cells * * @param width the new width of the cells * @param height the new height of the cells */ public void setCellDimensions(int width, int height) { mFixedCellWidth = mCellWidth = width; mFixedCellHeight = mCellHeight = height; Loading @@ -386,6 +377,33 @@ public class CellLayout extends ViewGroup { mBorderSpace); } private void resetCellSizeInternal(DeviceProfile deviceProfile) { switch (mContainerType) { case FOLDER: mBorderSpace = new Point(deviceProfile.folderCellLayoutBorderSpacePx); break; case HOTSEAT: mBorderSpace = new Point(deviceProfile.hotseatBorderSpace, deviceProfile.hotseatBorderSpace); break; case WORKSPACE: default: mBorderSpace = new Point(deviceProfile.cellLayoutBorderSpacePx); break; } mCellWidth = mCellHeight = -1; mFixedCellWidth = mFixedCellHeight = -1; } /** * Reset the cell sizes and border space */ public void resetCellSize(DeviceProfile deviceProfile) { resetCellSizeInternal(deviceProfile); requestLayout(); } public void setGridSize(int x, int y) { mCountX = x; mCountY = y; Loading
src/com/android/launcher3/Hotseat.java +1 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ public class Hotseat extends CellLayout implements Insettable { removeAllViewsInLayout(); mHasVerticalHotseat = hasVerticalHotseat; DeviceProfile dp = mActivity.getDeviceProfile(); resetCellSize(dp); if (hasVerticalHotseat) { setGridSize(1, dp.numShownHotseatIcons); } else { Loading