From 1c5e607940b725ee30e87a78bf7674a5ccee7a30 Mon Sep 17 00:00:00 2001 From: "sfufa@google.com" Date: Tue, 5 Oct 2021 18:08:05 -0700 Subject: [PATCH] [Search] Scale up small search icons on drag start Bug: 199341710 Test: manual Change-Id: I243c3e84e3093d4a9c605b187a625c0580d9933f --- src/com/android/launcher3/Utilities.java | 6 ++++++ src/com/android/launcher3/dragndrop/DragView.java | 1 + 2 files changed, 7 insertions(+) diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index b92cf09186..36faeee47a 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -45,6 +45,7 @@ import android.graphics.Paint; import android.graphics.Point; import android.graphics.Rect; import android.graphics.RectF; +import android.graphics.drawable.AdaptiveIconDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.InsetDrawable; @@ -80,6 +81,7 @@ import com.android.launcher3.icons.LauncherIcons; import com.android.launcher3.icons.ShortcutCachingLogic; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.ItemInfoWithIcon; +import com.android.launcher3.model.data.SearchActionItemInfo; import com.android.launcher3.pm.ShortcutConfigActivityInfo; import com.android.launcher3.shortcuts.ShortcutKey; import com.android.launcher3.shortcuts.ShortcutRequest; @@ -705,6 +707,10 @@ public final class Utilities { } outObj[0] = icon; return icon; + } else if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_SEARCH_ACTION + && info instanceof SearchActionItemInfo) { + return new AdaptiveIconDrawable( + new FastBitmapDrawable(((SearchActionItemInfo) info).bitmap), null); } else { return null; } diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java index 57d6cc36ca..fa65945da3 100644 --- a/src/com/android/launcher3/dragndrop/DragView.java +++ b/src/com/android/launcher3/dragndrop/DragView.java @@ -205,6 +205,7 @@ public abstract class DragView extends Fram @TargetApi(Build.VERSION_CODES.O) public void setItemInfo(final ItemInfo info) { if (info.itemType != LauncherSettings.Favorites.ITEM_TYPE_APPLICATION + && info.itemType != LauncherSettings.Favorites.ITEM_TYPE_SEARCH_ACTION && info.itemType != LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT && info.itemType != LauncherSettings.Favorites.ITEM_TYPE_FOLDER) { return;