From 892c74d460ad98c6306420e1127c9aa3e505ba25 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 22 Aug 2013 16:15:50 -0700 Subject: Fixing folders to always show in view, removing old assets and references to LauncherModel count. --- src/com/android/launcher3/CellLayout.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/com/android/launcher3/CellLayout.java') diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 52b76b8ce..3c4180464 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -189,6 +189,8 @@ public class CellLayout extends ViewGroup { setClipToPadding(false); mLauncher = (Launcher) context; + LauncherAppState app = LauncherAppState.getInstance(); + DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CellLayout, defStyle, 0); mCellWidth = -1; @@ -196,8 +198,8 @@ public class CellLayout extends ViewGroup { mWidthGap = mOriginalWidthGap = 0; mHeightGap = mOriginalHeightGap = 0; mMaxGap = Integer.MAX_VALUE; - mCountX = LauncherModel.getCellCountX(); - mCountY = LauncherModel.getCellCountY(); + mCountX = (int) grid.numColumns; + mCountY = (int) grid.numRows; mOccupied = new boolean[mCountX][mCountY]; mTmpOccupied = new boolean[mCountX][mCountY]; mPreviousReorderDirection[0] = INVALID_DIRECTION; @@ -208,8 +210,6 @@ public class CellLayout extends ViewGroup { setAlwaysDrawnWithCacheEnabled(false); final Resources res = getResources(); - LauncherAppState app = LauncherAppState.getInstance(); - DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); mHotseatScale = (float) grid.hotseatIconSize / grid.iconSize; mNormalBackground = res.getDrawable(R.drawable.homescreen_blue_normal_holo); @@ -1204,6 +1204,11 @@ public class CellLayout extends ViewGroup { int left = topLeft[0]; int top = topLeft[1]; + // Offset icons by their padding + if (v instanceof BubbleTextView) { + top += v.getPaddingTop(); + } + if (v != null && dragOffset == null) { // When drawing the drag outline, it did not account for margin offsets // added by the view's parent. -- cgit v1.2.3