diff options
author | Jon Miranda <jonmiranda@google.com> | 2019-11-20 12:31:15 -0800 |
---|---|---|
committer | Jonathan Miranda <jonmiranda@google.com> | 2019-11-21 22:16:36 +0000 |
commit | a3ea27de3941f2802361aff1d46547122f096c7d (patch) | |
tree | 3cfa5ca3ee0c0f6619559960fddb7ecb4f9bed55 /quickstep | |
parent | f3761296a1a94086a3f7bc37cc6d3cada73d5d87 (diff) | |
download | packages_apps_Trebuchet-a3ea27de3941f2802361aff1d46547122f096c7d.tar.gz packages_apps_Trebuchet-a3ea27de3941f2802361aff1d46547122f096c7d.tar.bz2 packages_apps_Trebuchet-a3ea27de3941f2802361aff1d46547122f096c7d.zip |
Fix bug where icon remains invisible after returning home.
- The bug is caused by cancelling of the RectFSpringAnim before the
StaggeredWorkspaceAnim has started.
- Instead of having logic in StaggeredWorkspaceAnim control the visibility
of the icon, we instead maintain all the visibility within the
FloatingIconView class itself.
Bug: 142120338
Change-Id: I94f3a066d395f9c3b97dc6ee9fc836e9401650a5
Merged-In: I082291ca9b288f57701cc00d61a9b3a84da8b084
Diffstat (limited to 'quickstep')
3 files changed, 6 insertions, 40 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java index 7ffffeda1..86aa43044 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java @@ -398,8 +398,8 @@ public class NoButtonQuickSwitchTouchController implements TouchController, updateNonOverviewAnim(targetState, new AnimatorSetBuilder(), 0 /* animComponents */); nonOverviewAnim = mNonOverviewAnim.getAnimationPlayer(); - new StaggeredWorkspaceAnim(mLauncher, null, velocity.y, - false /* animateOverviewScrim */).start(); + new StaggeredWorkspaceAnim(mLauncher, velocity.y, false /* animateOverviewScrim */) + .start(); } else { boolean canceled = targetState == NORMAL; if (canceled) { 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 eefde1286..c0be9ec3e 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java @@ -166,8 +166,8 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe @Override public void playAtomicAnimation(float velocity) { - new StaggeredWorkspaceAnim(activity, workspaceView, velocity, - true /* animateOverviewScrim */).start(); + new StaggeredWorkspaceAnim(activity, velocity, true /* animateOverviewScrim */) + .start(); } }; } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java index 5f02de2b9..958ef7d4f 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java @@ -28,8 +28,6 @@ import android.animation.ObjectAnimator; import android.view.View; import android.view.ViewGroup; -import androidx.annotation.Nullable; - import com.android.launcher3.CellLayout; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; @@ -43,7 +41,6 @@ import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.PropertySetter; import com.android.launcher3.anim.SpringObjectAnimator; import com.android.launcher3.graphics.OverviewScrim; -import com.android.launcher3.views.IconLabelDotView; import com.android.quickstep.views.RecentsView; import java.util.ArrayList; @@ -67,20 +64,12 @@ public class StaggeredWorkspaceAnim { private final float mVelocity; private final float mSpringTransY; - // The original view of the {@link FloatingIconView}. - private final View mOriginalView; - private final List<Animator> mAnimators = new ArrayList<>(); - /** - * @param floatingViewOriginalView The FloatingIconView's original view. - */ - public StaggeredWorkspaceAnim(Launcher launcher, @Nullable View floatingViewOriginalView, - float velocity, boolean animateOverviewScrim) { + public StaggeredWorkspaceAnim(Launcher launcher, float velocity, boolean animateOverviewScrim) { prepareToAnimate(launcher); mVelocity = velocity; - mOriginalView = floatingViewOriginalView; // Scale the translationY based on the initial velocity to better sync the workspace items // with the floating view. @@ -212,35 +201,12 @@ public class StaggeredWorkspaceAnim { springTransY.setStartDelay(startDelay); mAnimators.add(springTransY); - ObjectAnimator alpha = getAlphaAnimator(v, startDelay); - if (v == mOriginalView) { - // For IconLabelDotViews, we just want the label to fade in. - // Icon, badge, and dots will animate in separately (controlled via FloatingIconView) - if (v instanceof IconLabelDotView) { - alpha.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationStart(Animator animation) { - IconLabelDotView view = (IconLabelDotView) v; - view.setIconVisible(false); - view.setForceHideDot(true); - } - }); - } else { - return; - } - } - v.setAlpha(0); - mAnimators.add(alpha); - } - - private ObjectAnimator getAlphaAnimator(View v, long startDelay) { ObjectAnimator alpha = ObjectAnimator.ofFloat(v, View.ALPHA, 0f, 1f); alpha.setInterpolator(LINEAR); alpha.setDuration(ALPHA_DURATION_MS); alpha.setStartDelay(startDelay); - return alpha; - + mAnimators.add(alpha); } private void addScrimAnimationForState(Launcher launcher, LauncherState state, long duration) { |