summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/CellLayout.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-03-25 19:23:43 -0700
committerAdam Cohen <adamcohen@google.com>2011-03-25 19:25:11 -0700
commit99e8b40b374d49baabf0c4f4e4278ac25828899b (patch)
tree2086f5f7e9c0384ea9c12c33330831b8b4d7f0b7 /src/com/android/launcher2/CellLayout.java
parentc2e26a028d1829bdddb1e47aac12951e12ef83e0 (diff)
downloadandroid_packages_apps_Trebuchet-99e8b40b374d49baabf0c4f4e4278ac25828899b.tar.gz
android_packages_apps_Trebuchet-99e8b40b374d49baabf0c4f4e4278ac25828899b.tar.bz2
android_packages_apps_Trebuchet-99e8b40b374d49baabf0c4f4e4278ac25828899b.zip
Fixing drag outline location on phone-sized UI (bug 4174465)
Change-Id: If1cf60f60fe2cf17704ff330fdbc076ae6e944f5
Diffstat (limited to 'src/com/android/launcher2/CellLayout.java')
-rw-r--r--src/com/android/launcher2/CellLayout.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 825878af5..97518a5c5 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -956,13 +956,15 @@ public class CellLayout extends ViewGroup {
int top = topLeft[1];
if (v != null) {
- if (v.getParent() instanceof CellLayout) {
- LayoutParams lp = (LayoutParams) v.getLayoutParams();
- left += lp.leftMargin;
- top += lp.topMargin;
- }
-
- // Offsets due to the size difference between the View and the dragOutline
+ // When drawing the drag outline, it did not account for margin offsets
+ // added by the view's parent.
+ MarginLayoutParams lp = (MarginLayoutParams) v.getLayoutParams();
+ left += lp.leftMargin;
+ top += lp.topMargin;
+
+ // Offsets due to the size difference between the View and the dragOutline.
+ // There is a size difference to account for the outer blur, which may lie
+ // outside the bounds of the view.
left += (v.getWidth() - dragOutline.getWidth()) / 2;
top += (v.getHeight() - dragOutline.getHeight()) / 2;
}