diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index e699500e9c..7036639154 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -571,9 +571,11 @@ public final class Utilities { final boolean isFolderIcon = v instanceof FolderIcon; final Rect rect = new Rect(); + // Deep shortcut views have their icon drawn in a separate view. final boolean fromDeepShortcutView = v.getParent() instanceof DeepShortcutView; - if (fromDeepShortcutView) { - // Deep shortcut views have their icon drawn in a separate view. + if (v instanceof DeepShortcutView) { + dragLayer.getDescendantRectRelativeToSelf(((DeepShortcutView) v).getIconView(), rect); + } else if (fromDeepShortcutView) { DeepShortcutView view = (DeepShortcutView) v.getParent(); dragLayer.getDescendantRectRelativeToSelf(view.getIconView(), rect); } else if ((isBubbleTextView || isFolderIcon) && v.getTag() instanceof ItemInfo diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index 7af2bd87b0..e5c70da5f6 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -50,6 +50,7 @@ import com.android.launcher3.folder.FolderShape; import com.android.launcher3.graphics.ShiftedBitmapDrawable; import com.android.launcher3.icons.LauncherIcons; import com.android.launcher3.popup.SystemShortcut; +import com.android.launcher3.shortcuts.DeepShortcutView; import androidx.annotation.Nullable; import androidx.annotation.WorkerThread; @@ -197,8 +198,14 @@ public class FloatingIconView extends View implements Animator.AnimatorListener, // Similar to DragView, we simply use the BubbleTextView icon here. drawable = ((BubbleTextView) v).getIcon(); } - if (v instanceof ImageView && info instanceof SystemShortcut) { - drawable = ((ImageView) v).getDrawable(); + if (info instanceof SystemShortcut) { + if (v instanceof ImageView) { + drawable = ((ImageView) v).getDrawable(); + } else if (v instanceof DeepShortcutView) { + drawable = ((DeepShortcutView) v).getIconView().getBackground(); + } else { + drawable = v.getBackground(); + } } if (drawable == null) { drawable = Utilities.getFullDrawable(launcher, info, lp.width, lp.height,