Fix some incorrect animation code that might be causing visual glitches.
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 5c1f570..3c6a8aa 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -212,6 +212,12 @@
                     // If an animation is started and then stopped very quickly, we can still
                     // get spurious updates we've cleared the tag. Guard against this.
                     if (outline == null) {
+                        if (false) {
+                            Object val = animation.getAnimatedValue();
+                            Log.d(TAG, "anim " + thisIndex + " update: " + val +
+                                     ", isStopped " + anim.isStopped());
+                        }
+
                         // Try to prevent it from continuing to run
                         animation.cancel();
                     } else {
@@ -1138,15 +1144,14 @@
      * or it may have begun on another layout.
      */
     void onDragEnter(View dragView) {
-        if (mDragging) {
+        if (!mDragging) {
 //            Log.d(TAG, "Received onDragEnter while drag still active");
+            // Fade in the drag indicators
+            if (mCrosshairsAnimator != null) {
+                mCrosshairsAnimator.animateIn();
+            }
         }
         mDragging = true;
-
-        // Fade in the drag indicators
-        if (mCrosshairsAnimator != null) {
-            mCrosshairsAnimator.animateIn();
-        }
     }
 
     /**
diff --git a/src/com/android/launcher2/InterruptibleInOutAnimator.java b/src/com/android/launcher2/InterruptibleInOutAnimator.java
index 920aa43..0b2f345 100644
--- a/src/com/android/launcher2/InterruptibleInOutAnimator.java
+++ b/src/com/android/launcher2/InterruptibleInOutAnimator.java
@@ -37,6 +37,12 @@
 
     private Object mTag = null;
 
+    private static final int STOPPED = 0;
+    private static final int IN = 1;
+    private static final int OUT = 2;
+
+    private int mDirection = STOPPED;
+
     public InterruptibleInOutAnimator(long duration, Object fromValue, Object toValue) {
         super(duration, fromValue, toValue);
         mOriginalDuration = duration;
@@ -44,26 +50,49 @@
         mOriginalToValue = toValue;
     }
 
-    private void animateTo(Object toValue) {
-        // This only makes sense when it's running in the opposite direction, or stopped.
-        setDuration(mOriginalDuration - getCurrentPlayTime());
-
+    private void animate(int direction) {
+        final long currentPlayTime = getCurrentPlayTime();
+        final Object toValue = (direction == IN) ? mOriginalToValue : mOriginalFromValue;
         final Object startValue = mFirstRun ? mOriginalFromValue : getAnimatedValue();
+
+        // Make sure it's stopped before we modify any values
         cancel();
+
         if (startValue != toValue) {
+            mDirection = direction;
+            setDuration(mOriginalDuration - currentPlayTime);
             setValues(startValue, toValue);
             start();
             mFirstRun = false;
         }
     }
 
+    @Override
+    public void cancel() {
+        super.cancel();
+        mDirection = STOPPED;
+    }
+
+    @Override
+    public void end() {
+        super.end();
+        mDirection = STOPPED;
+    }
+
+    /**
+     * Return true when the animation is not running and it hasn't even been started.
+     */
+    public boolean isStopped() {
+        return mDirection == STOPPED;
+    }
+
     /**
      * This is the equivalent of calling Animator.start(), except that it can be called when
      * the animation is running in the opposite direction, in which case we reverse
      * direction and animate for a correspondingly shorter duration.
      */
     public void animateIn() {
-        animateTo(mOriginalToValue);
+        animate(IN);
     }
 
     /**
@@ -73,7 +102,7 @@
      * direction and animate for a correspondingly shorter duration.
      */
     public void animateOut() {
-        animateTo(mOriginalFromValue);
+        animate(OUT);
     }
 
     public void setTag(Object tag) {