summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2009-06-01 14:54:59 -0700
committerRomain Guy <romainguy@android.com>2009-06-01 14:54:59 -0700
commit2eb49ff2a3f7066cae1768d2314c4f912bd6c28d (patch)
tree7ac3c66c1716c02f044e083fdc605e35aa2d1a27 /src
parent8283ccff7c44e3f2a62496167159228eb50706b6 (diff)
downloadandroid_packages_apps_Trebuchet-2eb49ff2a3f7066cae1768d2314c4f912bd6c28d.tar.gz
android_packages_apps_Trebuchet-2eb49ff2a3f7066cae1768d2314c4f912bd6c28d.tar.bz2
android_packages_apps_Trebuchet-2eb49ff2a3f7066cae1768d2314c4f912bd6c28d.zip
Fixes #1889268.
Dragging an icon out of a folder was showing a gray background. This was due to the icon's drawing cache background color. This fix simply temporarily resets that color when capturing the view into a Bitmap.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher/DragLayer.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/launcher/DragLayer.java b/src/com/android/launcher/DragLayer.java
index b5b84b86e..2e59b1066 100644
--- a/src/com/android/launcher/DragLayer.java
+++ b/src/com/android/launcher/DragLayer.java
@@ -195,8 +195,13 @@ public class DragLayer extends FrameLayout implements DragController {
boolean willNotCache = v.willNotCacheDrawing();
v.setWillNotCacheDrawing(false);
- v.buildDrawingCache();
+ // Reset the drawing cache background color to fully transparent
+ // for the duration of this operation
+ int color = v.getDrawingCacheBackgroundColor();
+ v.setDrawingCacheBackgroundColor(0);
+
+ v.buildDrawingCache();
Bitmap viewBitmap = v.getDrawingCache();
int width = viewBitmap.getWidth();
int height = viewBitmap.getHeight();
@@ -218,6 +223,7 @@ public class DragLayer extends FrameLayout implements DragController {
mDragBitmap = Bitmap.createBitmap(viewBitmap, 0, 0, width, height, scale, true);
v.destroyDrawingCache();
v.setWillNotCacheDrawing(willNotCache);
+ v.setDrawingCacheBackgroundColor(color);
final Bitmap dragBitmap = mDragBitmap;
mBitmapOffsetX = (dragBitmap.getWidth() - width) / 2;