From 0d3c3d8fc551cab0fad8a47375898bcbf5acd3cf Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Wed, 5 Oct 2022 00:57:09 -0700 Subject: [PATCH] Differentiate between app row and shortcut icons. This is a simplified version of ag/20118087. It fixes the bug with rows of shortcuts being in the search results (e.g. Gmail and WhatsApp conversations), but it will not handle cases where there are multiple rows of app icons. Currently I do not know of any cases where that would happen. Test: Manual with and without inject_web_top (which moves app row) for WhatsApp and Gmail with AiAi fishfood. Bug: 239927522 Change-Id: Ie9c62c0ee81086801942328c8770f37d5bf622c3 --- .../launcher3/allapps/SearchTransitionController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/SearchTransitionController.java b/src/com/android/launcher3/allapps/SearchTransitionController.java index a1f5bc696f..11ceb0a55c 100644 --- a/src/com/android/launcher3/allapps/SearchTransitionController.java +++ b/src/com/android/launcher3/allapps/SearchTransitionController.java @@ -20,6 +20,7 @@ import static android.view.View.VISIBLE; import static androidx.recyclerview.widget.RecyclerView.NO_POSITION; +import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback; import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7; @@ -38,6 +39,7 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.Utilities; +import com.android.launcher3.model.data.ItemInfo; /** Coordinates the transition between Search and A-Z in All Apps. */ public class SearchTransitionController { @@ -186,7 +188,9 @@ public class SearchTransitionController { top = searchResultView.getTop(); } - if (searchResultView instanceof BubbleTextView) { + if (searchResultView instanceof BubbleTextView + && searchResultView.getTag() instanceof ItemInfo + && ((ItemInfo) searchResultView.getTag()).itemType == ITEM_TYPE_APPLICATION) { // The first app icon will set appRowHeight, which will also contribute to // totalHeight. Additional app icons should remove the appRowHeight to remain in // the same row as the first app. @@ -196,6 +200,8 @@ public class SearchTransitionController { totalHeight += appRowHeight; } // Don't scale/fade app row. + searchResultView.setScaleY(1); + searchResultView.setAlpha(1); continue; }