diff options
Diffstat (limited to 'src/com/android/launcher2/PagedViewCellLayout.java')
-rw-r--r-- | src/com/android/launcher2/PagedViewCellLayout.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java index 28bb78b9a..53657e5cb 100644 --- a/src/com/android/launcher2/PagedViewCellLayout.java +++ b/src/com/android/launcher2/PagedViewCellLayout.java @@ -243,6 +243,15 @@ public class PagedViewCellLayout extends ViewGroup implements Page { setMeasuredDimension(newWidth, newHeight); } + int getContentWidth() { + // Return the distance from the left edge of the content of the leftmost icon to + // the right edge of the content of the rightmost icon + + // icons are centered within cells, find out how much offset that accounts for + int iconHorizontalOffset = (mCellWidth - Utilities.getIconContentSize()); + return mCellCountX * mCellWidth + (mCellCountX - 1) * mWidthGap - iconHorizontalOffset; + } + @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { int count = getChildCount(); @@ -281,17 +290,6 @@ public class PagedViewCellLayout extends ViewGroup implements Page { mHolographicChildren.setGap(widthGap, heightGap); } - public void setCellDimensions(int width, int height) { - mCellWidth = width; - mCellHeight = height; - mChildren.setCellDimensions(width, height); - mHolographicChildren.setCellDimensions(width, height); - } - - public int getDefaultCellDimensions() { - return sDefaultCellDimensions; - } - public int[] getCellCountForDimensions(int width, int height) { // Always assume we're working with the smallest span to make sure we // reserve enough space in both orientations |