summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-11-23 17:00:17 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-23 17:00:17 -0800
commit8171d8ce48765cbc9e6ed96ac3dc173a8969616d (patch)
tree15b4929f812dc203644049f1d6a5392e10773f92
parent65f9e9d45b8ba9aa819be2c4fca1722db7784868 (diff)
parent1120e0355798391712f1d2e2b205f0bd3724770c (diff)
downloadpackages_apps_trebuchet-8171d8ce48765cbc9e6ed96ac3dc173a8969616d.zip
packages_apps_trebuchet-8171d8ce48765cbc9e6ed96ac3dc173a8969616d.tar.gz
packages_apps_trebuchet-8171d8ce48765cbc9e6ed96ac3dc173a8969616d.tar.bz2
Merge "Fixing issue where shortcut holographic outlines were different than widgets. (Bug 5659891)" into ics-mr1
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java31
-rw-r--r--src/com/android/launcher2/Workspace.java4
2 files changed, 20 insertions, 15 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index ca02e1e..b732eec 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -560,7 +560,8 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
PendingAddItemInfo createItemInfo = (PendingAddItemInfo) v.getTag();
// Compose the drag image
- Bitmap b;
+ Bitmap preview;
+ Bitmap outline;
if (createItemInfo instanceof PendingAddWidgetInfo) {
PendingAddWidgetInfo createWidgetInfo = (PendingAddWidgetInfo) createItemInfo;
int[] spanXY = mLauncher.getSpanForWidget(createWidgetInfo, null);
@@ -569,20 +570,17 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
int[] maxSize = mLauncher.getWorkspace().estimateItemSize(spanXY[0], spanXY[1],
createWidgetInfo, true);
- b = getWidgetPreview(createWidgetInfo.componentName, createWidgetInfo.previewImage,
+ preview = getWidgetPreview(createWidgetInfo.componentName, createWidgetInfo.previewImage,
createWidgetInfo.icon, spanXY[0], spanXY[1], maxSize[0], maxSize[1]);
} else {
// Workaround for the fact that we don't keep the original ResolveInfo associated with
// the shortcut around. To get the icon, we just render the preview image (which has
// the shortcut icon) to a new drag bitmap that clips the non-icon space.
- b = Bitmap.createBitmap(mWidgetPreviewIconPaddedDimension,
+ preview = Bitmap.createBitmap(mWidgetPreviewIconPaddedDimension,
mWidgetPreviewIconPaddedDimension, Bitmap.Config.ARGB_8888);
- Drawable preview = image.getDrawable();
- mCanvas.setBitmap(b);
- mCanvas.save();
- preview.draw(mCanvas);
- mCanvas.restore();
- mCanvas.drawColor(mDragViewMultiplyColor, PorterDuff.Mode.MULTIPLY);
+ Drawable d = image.getDrawable();
+ mCanvas.setBitmap(preview);
+ d.draw(mCanvas);
mCanvas.setBitmap(null);
createItemInfo.spanX = createItemInfo.spanY = 1;
}
@@ -597,12 +595,21 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
}
+ // Save the preview for the outline generation, then dim the preview
+ outline = Bitmap.createScaledBitmap(preview, preview.getWidth(), preview.getHeight(),
+ false);
+ mCanvas.setBitmap(preview);
+ mCanvas.drawColor(mDragViewMultiplyColor, PorterDuff.Mode.MULTIPLY);
+ mCanvas.setBitmap(null);
+
// Start the drag
+ alphaClipPaint = null;
mLauncher.lockScreenOrientationOnLargeUI();
- mLauncher.getWorkspace().onDragStartedWithItem(createItemInfo, b, alphaClipPaint);
- mDragController.startDrag(image, b, this, createItemInfo,
+ mLauncher.getWorkspace().onDragStartedWithItem(createItemInfo, outline, alphaClipPaint);
+ mDragController.startDrag(image, preview, this, createItemInfo,
DragController.DRAG_ACTION_COPY, null);
- b.recycle();
+ outline.recycle();
+ preview.recycle();
}
@Override
protected boolean beginDragging(View v) {
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 60f57c2..d4e8ad4 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -1891,9 +1891,7 @@ public class Workspace extends SmoothPagedView
// center the image
dst.offset((w - scaledWidth) / 2, (h - scaledHeight) / 2);
- Paint p = new Paint();
- p.setFilterBitmap(true);
- canvas.drawBitmap(orig, src, dst, p);
+ canvas.drawBitmap(orig, src, dst, null);
mOutlineHelper.applyMediumExpensiveOutlineWithBlur(b, canvas, outlineColor, outlineColor,
alphaClipPaint);
canvas.setBitmap(null);