summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/CellLayout.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-10-08 17:00:19 -0700
committerWinson Chung <winsonc@google.com>2013-10-08 17:00:19 -0700
commit69737c3e49ff3edc42899609fdbc96e356f8638e (patch)
tree21c79dde9cfb0ea7e1793e243a7c8d50efb61426 /src/com/android/launcher3/CellLayout.java
parent82a9bd2c03645494cb0965abc03a9a18823e07e5 (diff)
downloadandroid_packages_apps_Trebuchet-69737c3e49ff3edc42899609fdbc96e356f8638e.tar.gz
android_packages_apps_Trebuchet-69737c3e49ff3edc42899609fdbc96e356f8638e.tar.bz2
android_packages_apps_Trebuchet-69737c3e49ff3edc42899609fdbc96e356f8638e.zip
Ensuring that we offset cell items by their destination cell padding. (Bug 10881814)
Change-Id: Idc16ae64b1a0e7f79b8a3ff5da6854fbab7867d2
Diffstat (limited to 'src/com/android/launcher3/CellLayout.java')
-rw-r--r--src/com/android/launcher3/CellLayout.java16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 5c6a694c0..b17f5b439 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -115,7 +115,6 @@ public class CellLayout extends ViewGroup {
// If we're actively dragging something over this screen, mIsDragOverlapping is true
private boolean mIsDragOverlapping = false;
- private final Point mDragCenter = new Point();
boolean mUseActiveGlowBackground = false;
// These arrays are used to implement the drag visualization on x-large screens.
@@ -1204,12 +1203,6 @@ public class CellLayout extends ViewGroup {
final int oldDragCellX = mDragCell[0];
final int oldDragCellY = mDragCell[1];
- if (v != null && dragOffset == null) {
- mDragCenter.set(originX + (v.getWidth() / 2), originY + (v.getHeight() / 2));
- } else {
- mDragCenter.set(originX, originY);
- }
-
if (dragOutline == null && v == null) {
return;
}
@@ -1224,11 +1217,6 @@ 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.
@@ -1249,7 +1237,9 @@ public class CellLayout extends ViewGroup {
// outline offset
left += dragOffset.x + ((mCellWidth * spanX) + ((spanX - 1) * mWidthGap)
- dragRegion.width()) / 2;
- top += dragOffset.y;
+ int cHeight = getShortcutsAndWidgets().getCellContentHeight();
+ int cellPaddingY = (int) Math.max(0, ((mCellHeight - cHeight) / 2f));
+ top += dragOffset.y + cellPaddingY;
} else {
// Center the drag outline in the cell
left += ((mCellWidth * spanX) + ((spanX - 1) * mWidthGap)