Merge "Turn off filter ui if flag is off" into tm-qpr-dev am: 4835519ccb

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20861034

Change-Id: I38f2653dbb9d18351f0395554b4c26613f7b5975
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/quickstep/res/layout/task.xml b/quickstep/res/layout/task.xml
index 02a439d..bd11c1e 100644
--- a/quickstep/res/layout/task.xml
+++ b/quickstep/res/layout/task.xml
@@ -28,12 +28,14 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"/>
 
+    <!-- Filtering affects only alpha instead of the visibility since visibility can be altered
+         separately through RecentsView#resetFromSplitSelectionState() -->
     <ImageView
         android:id="@+id/show_windows"
         android:layout_height="@dimen/recents_filter_icon_size"
         android:layout_width="@dimen/recents_filter_icon_size"
         android:layout_gravity="end"
-        android:visibility="gone"
+        android:alpha="0"
         android:tint="@color/recents_filter_icon"
         android:contentDescription="@string/recents_filter_icon_desc"
         android:importantForAccessibility="no"
diff --git a/quickstep/res/layout/task_grouped.xml b/quickstep/res/layout/task_grouped.xml
index 7792801..ec03c69 100644
--- a/quickstep/res/layout/task_grouped.xml
+++ b/quickstep/res/layout/task_grouped.xml
@@ -38,23 +38,27 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"/>
 
+    <!-- Filtering affects only alpha instead of the visibility since visibility can be altered
+         separately through RecentsView#resetFromSplitSelectionState() -->
     <ImageView
         android:id="@+id/show_windows"
         android:layout_height="@dimen/recents_filter_icon_size"
         android:layout_width="@dimen/recents_filter_icon_size"
         android:layout_gravity="start"
-        android:visibility="gone"
+        android:alpha="0"
         android:tint="@color/recents_filter_icon"
         android:contentDescription="@string/recents_filter_icon_desc"
         android:importantForAccessibility="no"
         android:src="@drawable/ic_select_windows" />
 
+    <!-- Filtering affects only alpha instead of the visibility since visibility can be altered
+         separately through RecentsView#resetFromSplitSelectionState() -->
     <ImageView
         android:id="@+id/show_windows_right"
         android:layout_height="@dimen/recents_filter_icon_size"
         android:layout_width="@dimen/recents_filter_icon_size"
         android:layout_gravity="end"
-        android:visibility="gone"
+        android:alpha="0"
         android:tint="@color/recents_filter_icon"
         android:contentDescription="@string/recents_filter_icon_desc"
         android:importantForAccessibility="no"
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index 1d9e05f..aa37fdd 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -561,10 +561,12 @@
      */
     protected void updateFilterCallback(@NonNull View filterView,
             @Nullable View.OnClickListener callback) {
+        // Filtering changes alpha instead of the visibility since visibility
+        // can be altered separately through RecentsView#resetFromSplitSelectionState()
         if (callback == null) {
-            filterView.setVisibility(GONE);
+            filterView.setAlpha(0);
         } else {
-            filterView.setVisibility(VISIBLE);
+            filterView.setAlpha(1);
         }
 
         filterView.setOnClickListener(callback);