summaryrefslogtreecommitdiffstats
path: root/quickstep
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2018-02-27 15:24:35 -0800
committerJonathan Miranda <jonmiranda@google.com>2018-02-28 03:51:03 +0000
commit93e9dbddc554bcb851c6ff6c838a199239249fa1 (patch)
tree9f3a24097b5d2272406b6dc08ba822b6f6169e0c /quickstep
parent8168252567b737f9bb0a84d84cf64fe93d3d798b (diff)
downloadandroid_packages_apps_Trebuchet-93e9dbddc554bcb851c6ff6c838a199239249fa1.tar.gz
android_packages_apps_Trebuchet-93e9dbddc554bcb851c6ff6c838a199239249fa1.tar.bz2
android_packages_apps_Trebuchet-93e9dbddc554bcb851c6ff6c838a199239249fa1.zip
Fix app opening transition for deep shortcuts.
With this change, the floating view now starts on top of the deep shortcut icon; before this change the view stared in the middle of the text portion of the view. Bug: 70220260 Change-Id: I7a1ed705f6f8d9d2ff594f52c4cf678aa0575012
Diffstat (limited to 'quickstep')
-rw-r--r--quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
index b614d1510..1df8cfd28 100644
--- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
+++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
@@ -51,6 +51,8 @@ import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.anim.PropertyListBuilder;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.graphics.DrawableFactory;
+import com.android.launcher3.shortcuts.DeepShortcutTextView;
+import com.android.launcher3.shortcuts.DeepShortcutView;
import com.android.quickstep.RecentsAnimationInterpolator;
import com.android.quickstep.RecentsAnimationInterpolator.TaskWindowBounds;
import com.android.quickstep.RecentsView;
@@ -498,7 +500,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
* @return Animator that controls the icon used to launch the target.
*/
private AnimatorSet getIconAnimator(View v) {
- boolean isBubbleTextView = v instanceof BubbleTextView;
+ final boolean isBubbleTextView = v instanceof BubbleTextView;
mFloatingView = new View(mLauncher);
if (isBubbleTextView && v.getTag() instanceof ItemInfoWithIcon ) {
// Create a copy of the app icon
@@ -510,14 +512,24 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
// Position the floating view exactly on top of the original
Rect rect = new Rect();
- mDragLayer.getDescendantRectRelativeToSelf(v, rect);
- int viewLocationStart = mIsRtl
+ 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.
+ DeepShortcutView view = (DeepShortcutView) v.getParent();
+ mDragLayer.getDescendantRectRelativeToSelf(view.getIconView(), rect);
+ } else {
+ mDragLayer.getDescendantRectRelativeToSelf(v, rect);
+ }
+ final int viewLocationStart = mIsRtl
? mDeviceProfile.widthPx - rect.right
: rect.left;
- int viewLocationTop = rect.top;
+ final int viewLocationTop = rect.top;
- if (isBubbleTextView) {
+ if (isBubbleTextView && !isDeepShortcutTextView) {
((BubbleTextView) v).getIconBounds(rect);
+ } else {
+ rect.set(0, 0, rect.width(), rect.height());
}
LayoutParams lp = new LayoutParams(rect.width(), rect.height());
lp.ignoreInsets = true;