Fix logic to get icon from any view that is a child of DeepShortcutView.
Change-Id: Ie05b2c2bb1b9d69e44f7869d80c52ecc2e5437db
diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
index 3b75001..6cd7b73 100644
--- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
+++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
@@ -588,10 +588,9 @@
// 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 @@
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 @@
*/
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) {