From d3c91fa058046807ee03ae78058725b12a69a688 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Tue, 13 Mar 2018 10:26:20 -0700 Subject: [PATCH] Fix logic to get icon from any view that is a child of DeepShortcutView. Change-Id: Ie05b2c2bb1b9d69e44f7869d80c52ecc2e5437db --- .../LauncherAppTransitionManagerImpl.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java index 3b75001eaf..6cd7b732b1 100644 --- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java +++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java @@ -588,10 +588,9 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag // Position the floating view exactly on top of the original Rect rect = new Rect(); - final boolean isDeepShortcutTextView = v instanceof DeepShortcutTextView - && v.getParent() != null && v.getParent() instanceof DeepShortcutView; - if (isDeepShortcutTextView) { - // Deep shortcut views have their icon drawn in a sibling view. + final boolean fromDeepShortcutView = v.getParent() instanceof DeepShortcutView; + if (fromDeepShortcutView) { + // Deep shortcut views have their icon drawn in a separate view. DeepShortcutView view = (DeepShortcutView) v.getParent(); mDragLayer.getDescendantRectRelativeToSelf(view.getIconView(), rect); } else { @@ -603,7 +602,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag final int viewLocationTop = rect.top; float startScale = 1f; - if (isBubbleTextView && !isDeepShortcutTextView) { + if (isBubbleTextView && !fromDeepShortcutView) { BubbleTextView btv = (BubbleTextView) v; btv.getIconBounds(rect); Drawable dr = btv.getIcon(); @@ -671,10 +670,8 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag */ private ValueAnimator getWindowAnimators(View v, RemoteAnimationTargetCompat[] targets) { Rect bounds = new Rect(); - boolean isDeepShortcutTextView = v instanceof DeepShortcutTextView - && v.getParent() != null && v.getParent() instanceof DeepShortcutView; - if (isDeepShortcutTextView) { - // Deep shortcut views have their icon drawn in a sibling view. + if (v.getParent() instanceof DeepShortcutView) { + // Deep shortcut views have their icon drawn in a separate view. DeepShortcutView view = (DeepShortcutView) v.getParent(); mDragLayer.getDescendantRectRelativeToSelf(view.getIconView(), bounds); } else if (v instanceof BubbleTextView) {