Merge "Disable input while animating clear all on Go" into ub-launcher3-master
diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
index 8976c44..5bb4c5a 100644
--- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
@@ -89,6 +89,7 @@
     private RecyclerView mTaskRecyclerView;
     private View mEmptyView;
     private View mContentView;
+    private View mClearAllView;
     private boolean mTransitionedFromApp;
 
     public IconRecentsView(Context context, AttributeSet attrs) {
@@ -125,12 +126,22 @@
                     updateContentViewVisibility();
                 }
             });
-
-            View clearAllView = findViewById(R.id.clear_all_button);
-            clearAllView.setOnClickListener(v -> animateClearAllTasks());
+            mClearAllView = findViewById(R.id.clear_all_button);
+            mClearAllView.setOnClickListener(v -> animateClearAllTasks());
         }
     }
 
+
+    @Override
+    public void setEnabled(boolean enabled) {
+        super.setEnabled(enabled);
+        TaskItemView[] itemViews = getTaskViews();
+        for (TaskItemView itemView : itemViews) {
+            itemView.setEnabled(enabled);
+        }
+        mClearAllView.setEnabled(enabled);
+    }
+
     /**
      * Set activity helper for the view to callback to.
      *
@@ -204,6 +215,7 @@
      * Clear all tasks and animate out.
      */
     private void animateClearAllTasks() {
+        setEnabled(false);
         TaskItemView[] itemViews = getTaskViews();
 
         AnimatorSet clearAnim = new AnimatorSet();
@@ -249,6 +261,7 @@
                     itemView.setTranslationX(0);
                     itemView.setAlpha(1.0f);
                 }
+                setEnabled(true);
                 mContentView.setVisibility(GONE);
                 mTaskActionController.clearAllTasks();
             }