summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2010-02-24 10:04:17 -0800
committerRomain Guy <romainguy@android.com>2010-02-24 10:04:17 -0800
commitfb5411e98278d461b78aea0663d3e85f7a9e8a15 (patch)
treef7ab139e2cceba59e7391a786614f6671290bce9 /src
parent34c4db037b5c90ebfd8ffada595f5080d3b2d99a (diff)
downloadandroid_packages_apps_Trebuchet-fb5411e98278d461b78aea0663d3e85f7a9e8a15.tar.gz
android_packages_apps_Trebuchet-fb5411e98278d461b78aea0663d3e85f7a9e8a15.tar.bz2
android_packages_apps_Trebuchet-fb5411e98278d461b78aea0663d3e85f7a9e8a15.zip
Correctly position the quick contact badge when opened from a folder.
Bug #2467438
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/Folder.java13
-rw-r--r--src/com/android/launcher2/Launcher.java6
2 files changed, 8 insertions, 11 deletions
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 7c35f7997..435004d33 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -17,6 +17,7 @@
package com.android.launcher2;
import android.content.Context;
+import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
@@ -47,7 +48,6 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL
* Which item is being dragged
*/
protected ShortcutInfo mDragItem;
- private boolean mCloneInfo;
/**
* Used to inflate the Workspace from XML.
@@ -75,6 +75,10 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL
public void onItemClick(AdapterView parent, View v, int position, long id) {
ShortcutInfo app = (ShortcutInfo) parent.getItemAtPosition(position);
+ int[] pos = new int[2];
+ v.getLocationOnScreen(pos);
+ app.intent.setSourceBounds(new Rect(pos[0], pos[1],
+ pos[0] + v.getWidth(), pos[1] + v.getHeight()));
mLauncher.startActivitySafely(app.intent);
}
@@ -94,9 +98,6 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL
}
ShortcutInfo app = (ShortcutInfo) parent.getItemAtPosition(position);
- if (mCloneInfo) {
- app = new ShortcutInfo(app);
- }
mDragController.startDrag(view, this, app, DragController.DRAG_ACTION_COPY);
mLauncher.closeFolder(this);
@@ -105,10 +106,6 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL
return true;
}
- void setCloneInfo(boolean cloneInfo) {
- mCloneInfo = cloneInfo;
- }
-
public void setDragController(DragController dragController) {
mDragController = dragController;
}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 7f9b0d7e6..11b26c54f 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1258,11 +1258,11 @@ public final class Launcher extends Activity
Object tag = v.getTag();
if (tag instanceof ShortcutInfo) {
// Open shortcut
- final Intent intent = ((ShortcutInfo)tag).intent;
+ final Intent intent = ((ShortcutInfo) tag).intent;
int[] pos = new int[2];
v.getLocationOnScreen(pos);
- intent.setSourceBounds(
- new Rect(pos[0], pos[1], pos[0]+v.getWidth(), pos[1]+v.getHeight()));
+ intent.setSourceBounds(new Rect(pos[0], pos[1],
+ pos[0] + v.getWidth(), pos[1] + v.getHeight()));
startActivitySafely(intent);
} else if (tag instanceof FolderInfo) {
handleFolderClick((FolderInfo) tag);