diff options
author | Michael Jurka <mikejurka@google.com> | 2010-10-22 13:40:50 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2010-10-22 14:02:08 -0700 |
commit | 774bd377df3053ef43e34ab8ca98160eb6811be1 (patch) | |
tree | dda33b16ccaf00da3f9a17ec7df069cb6bf6d3ee | |
parent | 3b838ff548c129c8ea087a73f21e77a503d58f97 (diff) | |
download | android_packages_apps_Trebuchet-774bd377df3053ef43e34ab8ca98160eb6811be1.tar.gz android_packages_apps_Trebuchet-774bd377df3053ef43e34ab8ca98160eb6811be1.tar.bz2 android_packages_apps_Trebuchet-774bd377df3053ef43e34ab8ca98160eb6811be1.zip |
Fixing drag to application info button in All Apps
Change-Id: I6f31bf3ac24366791cf84830584846d57aab9b80
-rw-r--r-- | src/com/android/launcher2/ApplicationInfoDropTarget.java | 18 | ||||
-rw-r--r-- | src/com/android/launcher2/DeleteZone.java | 13 | ||||
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 2 |
3 files changed, 22 insertions, 11 deletions
diff --git a/src/com/android/launcher2/ApplicationInfoDropTarget.java b/src/com/android/launcher2/ApplicationInfoDropTarget.java index c4aa98cf7..fe5ffd190 100644 --- a/src/com/android/launcher2/ApplicationInfoDropTarget.java +++ b/src/com/android/launcher2/ApplicationInfoDropTarget.java @@ -99,10 +99,11 @@ public class ApplicationInfoDropTarget extends ImageView implements DropTarget, public void onDragStart(DragSource source, Object info, int dragAction) { if (info != null) { + final int itemType = ((ItemInfo)info).itemType; + mActive = (itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION); if (mManageVisibility) { - mActive = true; // Only show the info icon when an application is selected - if (((ItemInfo)info).itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) { + if (mActive) { setVisibility(VISIBLE); } mHandle.setVisibility(INVISIBLE); @@ -128,10 +129,15 @@ public class ApplicationInfoDropTarget extends ImageView implements DropTarget, public void getHitRect(Rect outRect) { super.getHitRect(outRect); if (LauncherApplication.isScreenXLarge()) { - outRect.top -= 50; - outRect.left -= 50; - outRect.bottom += 50; - outRect.right += 50; + // TODO: This is a temporary hack. mManageVisiblity = false when you're in CAB mode. + // In that case, this icon is more tightly spaced next to the delete icon so we want + // it to have a smaller drag region. When the new drag&drop system comes in, we'll + // dispatch the drag/drop by calculating what target you're overlapping + final int dragPadding = mManageVisibility ? 50 : 10; + outRect.top -= dragPadding; + outRect.left -= dragPadding; + outRect.bottom += dragPadding; + outRect.right += dragPadding; } } diff --git a/src/com/android/launcher2/DeleteZone.java b/src/com/android/launcher2/DeleteZone.java index e8f160f3c..4acde1c50 100644 --- a/src/com/android/launcher2/DeleteZone.java +++ b/src/com/android/launcher2/DeleteZone.java @@ -206,10 +206,15 @@ public class DeleteZone extends ImageView implements DropTarget, DragController. public void getHitRect(Rect outRect) { super.getHitRect(outRect); if (LauncherApplication.isScreenXLarge()) { - outRect.top -= 50; - outRect.left -= 50; - outRect.bottom += 50; - outRect.right += 50; + // TODO: This is a temporary hack. mManageVisiblity = false when you're in CAB mode. + // In that case, this icon is more tightly spaced next to the delete icon so we want + // it to have a smaller drag region. When the new drag&drop system comes in, we'll + // dispatch the drag/drop by calculating what target you're overlapping + final int dragPadding = mManageVisibility ? 50 : 10; + outRect.top -= dragPadding; + outRect.left -= dragPadding; + outRect.bottom += dragPadding; + outRect.right += dragPadding; } } diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 9e661917e..baec7e3f4 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -1883,7 +1883,7 @@ public final class Launcher extends Activity } /** - * Opens the user fodler described by the specified tag. The opening of the folder + * Opens the user folder described by the specified tag. The opening of the folder * is animated relative to the specified View. If the View is null, no animation * is played. * |