summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2009-06-12 13:52:17 -0700
committerRomain Guy <romainguy@android.com>2009-06-12 13:52:17 -0700
commit91a9c9636f10f1e12cd1f660b2e330634fbdc7dc (patch)
tree6aee33e1f72b77e4fd204e0cc49d0d38c716b547 /src/com/android/launcher
parentfca59c759ef9c7cc2fc062d14ede8bd57254abbf (diff)
downloadandroid_packages_apps_Trebuchet-91a9c9636f10f1e12cd1f660b2e330634fbdc7dc.tar.gz
android_packages_apps_Trebuchet-91a9c9636f10f1e12cd1f660b2e330634fbdc7dc.tar.bz2
android_packages_apps_Trebuchet-91a9c9636f10f1e12cd1f660b2e330634fbdc7dc.zip
When initiating a drag and drop from a folder in home, you could sometimes see
a black background behind the icon. This was due to uncleared drawing caches.
Diffstat (limited to 'src/com/android/launcher')
-rw-r--r--src/com/android/launcher/DragLayer.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/com/android/launcher/DragLayer.java b/src/com/android/launcher/DragLayer.java
index 2e59b1066..070c93841 100644
--- a/src/com/android/launcher/DragLayer.java
+++ b/src/com/android/launcher/DragLayer.java
@@ -53,7 +53,7 @@ public class DragLayer extends FrameLayout implements DragController {
private boolean mShouldDrop;
private float mLastMotionX;
private float mLastMotionY;
-
+
/**
* The bitmap that is currently being dragged
*/
@@ -67,42 +67,42 @@ public class DragLayer extends FrameLayout implements DragController {
* X offset from where we touched on the cell to its upper-left corner
*/
private float mTouchOffsetX;
-
+
/**
* Y offset from where we touched on the cell to its upper-left corner
*/
private float mTouchOffsetY;
-
+
/**
* Utility rectangle
*/
private Rect mDragRect = new Rect();
-
+
/**
* Where the drag originated
*/
private DragSource mDragSource;
-
+
/**
* The data associated with the object being dragged
*/
private Object mDragInfo;
- private final Rect mRect = new Rect();
+ private final Rect mRect = new Rect();
private final int[] mDropCoordinates = new int[2];
private final Vibrator mVibrator = new Vibrator();
-
+
private DragListener mListener;
private DragScroller mDragScroller;
-
+
private static final int SCROLL_OUTSIDE_ZONE = 0;
private static final int SCROLL_WAITING_IN_ZONE = 1;
private static final int SCROLL_LEFT = 0;
private static final int SCROLL_RIGHT = 1;
-
+
private int mScrollState = SCROLL_OUTSIDE_ZONE;
private ScrollRunnable mScrollRunnable = new ScrollRunnable();
@@ -201,6 +201,9 @@ public class DragLayer extends FrameLayout implements DragController {
int color = v.getDrawingCacheBackgroundColor();
v.setDrawingCacheBackgroundColor(0);
+ if (color != 0) {
+ v.destroyDrawingCache();
+ }
v.buildDrawingCache();
Bitmap viewBitmap = v.getDrawingCache();
int width = viewBitmap.getWidth();
@@ -582,7 +585,7 @@ public class DragLayer extends FrameLayout implements DragController {
}
public void removeDragListener(DragListener l) {
- mListener = null;
+ mListener = null;
}
/**
@@ -625,5 +628,5 @@ public class DragLayer extends FrameLayout implements DragController {
void setDirection(int direction) {
mDirection = direction;
}
- }
+ }
}