diff options
author | Jon Miranda <jonmiranda@google.com> | 2019-04-30 14:04:16 -0700 |
---|---|---|
committer | Jon Miranda <jonmiranda@google.com> | 2019-04-30 14:04:16 -0700 |
commit | 361ccf34900f0a987a85abdc62578c4a4f4e73df (patch) | |
tree | 65c84ab4fd86683fb07752eb13869b1fd08bb69c /quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java | |
parent | 943ce93bd5f542933d1dc75e5b78a1605b59bbee (diff) | |
download | android_packages_apps_Trebuchet-361ccf34900f0a987a85abdc62578c4a4f4e73df.tar.gz android_packages_apps_Trebuchet-361ccf34900f0a987a85abdc62578c4a4f4e73df.tar.bz2 android_packages_apps_Trebuchet-361ccf34900f0a987a85abdc62578c4a4f4e73df.zip |
Fix RTL bug when swiping up to home.
When you switch to RTL when an app is open, we try to use the BubbleTextView
that is no longer attached on the animation back to home. This causes the
item location to return the wrong values (since now the view doesn't have
valid padding/width we can use). In this case, we'll use the fallback
animation.
Bug: 131242470
Change-Id: I0ce27ee10bd6402cc6b2065813b034fc04592622
Diffstat (limited to 'quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java')
-rw-r--r-- | quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java index 3d2659d54..61d329b25 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java @@ -117,9 +117,11 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe workspaceView = null; } final Rect iconLocation = new Rect(); - final FloatingIconView floatingView = workspaceView == null ? null - : FloatingIconView.getFloatingIconView(activity, workspaceView, - true /* hideOriginal */, iconLocation, false /* isOpening */, null /* recycle */); + boolean canUseWorkspaceView = workspaceView != null && workspaceView.isAttachedToWindow(); + final FloatingIconView floatingView = canUseWorkspaceView + ? FloatingIconView.getFloatingIconView(activity, workspaceView, + true /* hideOriginal */, iconLocation, false /* isOpening */, null /* recycle */) + : null; return new HomeAnimationFactory() { @Nullable @@ -135,7 +137,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe final float targetCenterX = dp.availableWidthPx / 2f; final float targetCenterY = dp.availableHeightPx - dp.hotseatBarSizePx; - if (workspaceView != null) { + if (canUseWorkspaceView) { return new RectF(iconLocation); } else { // Fallback to animate to center of screen. |