diff options
author | Michael Jurka <mikejurka@google.com> | 2010-11-23 16:23:58 -0800 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2010-12-09 02:12:19 -0800 |
commit | d3ef3065ab0941567c45e9aec98783138b623c68 (patch) | |
tree | be6aeb8f76931cc504a8723824920e60d292b116 /src/com/android/launcher2/AllAppsPagedView.java | |
parent | 120980bd00f5eecec5717f49a3d7db96571025a9 (diff) | |
download | android_packages_apps_Trebuchet-d3ef3065ab0941567c45e9aec98783138b623c68.tar.gz android_packages_apps_Trebuchet-d3ef3065ab0941567c45e9aec98783138b623c68.tar.bz2 android_packages_apps_Trebuchet-d3ef3065ab0941567c45e9aec98783138b623c68.zip |
added spring loaded mode for adding items to workspace
Change-Id: Ie92294fe2b1d6697d84756a2fcea91a09f72825b
Diffstat (limited to 'src/com/android/launcher2/AllAppsPagedView.java')
-rw-r--r-- | src/com/android/launcher2/AllAppsPagedView.java | 14 |
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; } |