summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AllAppsPagedView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher2/AllAppsPagedView.java')
-rw-r--r--src/com/android/launcher2/AllAppsPagedView.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java
index 8d4ddba7f..2fd0b6569 100644
--- a/src/com/android/launcher2/AllAppsPagedView.java
+++ b/src/com/android/launcher2/AllAppsPagedView.java
@@ -21,7 +21,11 @@ import com.android.launcher.R;
import android.content.ComponentName;
import android.content.Context;
import android.content.res.TypedArray;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.AnimationUtils;
@@ -258,8 +262,14 @@ public class AllAppsPagedView extends PagedView
ApplicationInfo app = (ApplicationInfo) v.getTag();
app = new ApplicationInfo(app);
- mLauncher.getWorkspace().onDragStartedWithItemSpans(1, 1);
- mDragController.startDrag(v, this, app, DragController.DRAG_ACTION_COPY);
+ // get icon (top compound drawable, index is 1)
+ final Drawable icon = ((TextView) v).getCompoundDrawables()[1];
+ Bitmap b = Bitmap.createBitmap(icon.getIntrinsicWidth(), icon.getIntrinsicHeight(),
+ Bitmap.Config.ARGB_8888);
+ Canvas c = new Canvas(b);
+ icon.draw(c);
+ mLauncher.getWorkspace().onDragStartedWithItemSpans(1, 1, b);
+ mDragController.startDrag(v, b, this, app, DragController.DRAG_ACTION_COPY, null);
return true;
}