summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/CellLayout.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-08-22 16:15:50 -0700
committerWinson Chung <winsonc@google.com>2013-08-23 12:13:02 -0700
commit892c74d460ad98c6306420e1127c9aa3e505ba25 (patch)
tree5abbb89efdad34335ef876284d520f6c7a705e3f /src/com/android/launcher3/CellLayout.java
parentfe14e04987a8baf77f0ffbd6d66839f33a4f0474 (diff)
downloadandroid_packages_apps_Trebuchet-892c74d460ad98c6306420e1127c9aa3e505ba25.tar.gz
android_packages_apps_Trebuchet-892c74d460ad98c6306420e1127c9aa3e505ba25.tar.bz2
android_packages_apps_Trebuchet-892c74d460ad98c6306420e1127c9aa3e505ba25.zip
Fixing folders to always show in view, removing old assets and references to LauncherModel count.
Diffstat (limited to 'src/com/android/launcher3/CellLayout.java')
-rw-r--r--src/com/android/launcher3/CellLayout.java13
1 files changed, 9 insertions, 4 deletions
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.