diff options
author | Adam Cohen <adamcohen@google.com> | 2011-07-20 15:45:11 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2011-07-20 17:59:04 -0700 |
commit | fc53cd22c9a78708c78c85946443f23ec8c59502 (patch) | |
tree | a61a0f1ffd4729401c65a1a9d36f20593100fe8a /src/com/android/launcher2/DragView.java | |
parent | d8ff0e68e8a5184b59876e987dc5e65b2f82baf5 (diff) | |
download | android_packages_apps_Trebuchet-fc53cd22c9a78708c78c85946443f23ec8c59502.tar.gz android_packages_apps_Trebuchet-fc53cd22c9a78708c78c85946443f23ec8c59502.tar.bz2 android_packages_apps_Trebuchet-fc53cd22c9a78708c78c85946443f23ec8c59502.zip |
Fixing a couple bugs, allapps clicks and weird crash
-> issue 5021897 (when this was fixed, exposed more bugginess that is now fixed)
-> issue 5038392
Change-Id: I49a4e9fca154f75ea22ad2c462641747536102ce
Diffstat (limited to 'src/com/android/launcher2/DragView.java')
-rw-r--r-- | src/com/android/launcher2/DragView.java | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/com/android/launcher2/DragView.java b/src/com/android/launcher2/DragView.java index 1c75e470f..386cb55d3 100644 --- a/src/com/android/launcher2/DragView.java +++ b/src/com/android/launcher2/DragView.java @@ -41,6 +41,7 @@ public class DragView extends View { private Rect mDragRegion = null; private DragLayer mDragLayer = null; + private boolean mHasDrawn = false; ValueAnimator mAnim; private float mOffsetX = 0.0f; @@ -49,13 +50,6 @@ public class DragView extends View { private DragLayer.LayoutParams mLayoutParams; /** - * A callback to be called the first time this view is drawn. - * This allows the originator of the drag to dim or hide the original view as soon - * as the DragView is drawn. - */ - private Runnable mOnDrawRunnable = null; - - /** * Construct the drag view. * <p> * The registration point is the point inside our view that the touch events should @@ -125,10 +119,6 @@ public class DragView extends View { return mOffsetY; } - public void setOnDrawRunnable(Runnable r) { - mOnDrawRunnable = r; - } - public int getDragRegionLeft() { return mDragRegion.left; } @@ -168,14 +158,7 @@ public class DragView extends View { canvas.drawRect(0, 0, getWidth(), getHeight(), p); } - // Call the callback if we haven't already been detached - if (getParent() != null) { - if (mOnDrawRunnable != null) { - mOnDrawRunnable.run(); - mOnDrawRunnable = null; - } - } - + mHasDrawn = true; canvas.drawBitmap(mBitmap, 0.0f, 0.0f, mPaint); } @@ -184,6 +167,10 @@ public class DragView extends View { invalidate(); } + public boolean hasDrawn() { + return mHasDrawn; + } + @Override public void setAlpha(float alpha) { super.setAlpha(alpha); |