Allow touches to fall through AllApps nearing end of transition (Bug: 5991846, 6016062, 5991846)

- Also updating mTransitionProgress so control when drops succeed

Change-Id: I2f672c64f0a87249dcf7d254f963b8b2710c849f
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index a5964df..4639c57 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -53,6 +53,7 @@
     private LinearLayout mContent;
 
     private boolean mInTransition;
+    private boolean mTransitioningToWorkspace;
     private boolean mResetAfterTransition;
 
     public AppsCustomizeTabHost(Context context, AttributeSet attrs) {
@@ -154,8 +155,23 @@
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
     }
 
+     public boolean onInterceptTouchEvent(MotionEvent ev) {
+         // If we are mid transition then intercept touch events here so we can ignore them
+         if (mInTransition) {
+             return true;
+         }
+         return super.onInterceptTouchEvent(ev);
+     };
+
     @Override
     public boolean onTouchEvent(MotionEvent event) {
+        // Allow touch events to fall through if we are transitioning to the workspace
+        if (mInTransition) {
+            if (mTransitioningToWorkspace) {
+                return super.onTouchEvent(event);
+            }
+        }
+
         // Intercept all touch events up to the bottom of the AppsCustomizePane so they do not fall
         // through to the workspace and trigger showWorkspace()
         if (event.getY() < mAppsCustomizePane.getBottom()) {
@@ -349,6 +365,7 @@
     @Override
     public void onLauncherTransitionStart(Launcher l, boolean animated, boolean toWorkspace) {
         mInTransition = true;
+        mTransitioningToWorkspace = toWorkspace;
 
         if (toWorkspace) {
             // Going from All Apps -> Workspace
@@ -377,6 +394,11 @@
     }
 
     @Override
+    public void onLauncherTransitionStep(Launcher l, float t) {
+        // Do nothing
+    }
+
+    @Override
     public void onLauncherTransitionEnd(Launcher l, boolean animated, boolean toWorkspace) {
         mInTransition = false;
         if (animated) {