From afa327d176b925a833ac63f5da75cb62b0e4ea94 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Mon, 7 Jun 2021 15:02:05 -0700 Subject: [PATCH] Revert the squish translate from all apps Bug: 189973274 Bug: 189975416 Test: manual, attached video on the bug Change-Id: I881a2b79462e8d420b3dcb6a6b98adbe9e8e0394 --- .../allapps/AllAppsContainerView.java | 28 +++---------------- .../launcher3/views/SpringRelativeLayout.java | 2 +- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index cb20fec47a..681f5e7a30 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -669,30 +669,10 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo } public void onPull(float deltaDistance, float displacement) { - absorbPullDeltaDistance(PULL_MULTIPLIER * deltaDistance, - PULL_MULTIPLIER * displacement); - // ideally, this should be done using EdgeEffect.onPush to create squish effect. - // However, until such method is available, launcher to simulate the onPush method. - mHeader.setTranslationY(-.5f * mHeaderTop * deltaDistance); - getRecyclerViewContainer().setTranslationY(-mHeaderTop * deltaDistance); - } - - public void onRelease() { - ValueAnimator anim1 = ValueAnimator.ofFloat(1f, 0f); - final float floatingHeaderHeight = getFloatingHeaderView().getTranslationY(); - final float recyclerViewHeight = getRecyclerViewContainer().getTranslationY(); - anim1.setDuration(200); - anim1.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator valueAnimator) { - getFloatingHeaderView().setTranslationY( - ((float) valueAnimator.getAnimatedValue()) * floatingHeaderHeight); - getRecyclerViewContainer().setTranslationY( - ((float) valueAnimator.getAnimatedValue()) * recyclerViewHeight); - } - }); - anim1.start(); - super.onRelease(); + absorbPullDeltaDistance(PULL_MULTIPLIER * deltaDistance, PULL_MULTIPLIER * displacement); + // Current motion spec is to actually push and not pull + // on this surface. However, until EdgeEffect.onPush (b/190612804) is + // implemented at view level, we will simply pull } @Override diff --git a/src/com/android/launcher3/views/SpringRelativeLayout.java b/src/com/android/launcher3/views/SpringRelativeLayout.java index 8342d3e9d2..8e3ac20574 100644 --- a/src/com/android/launcher3/views/SpringRelativeLayout.java +++ b/src/com/android/launcher3/views/SpringRelativeLayout.java @@ -93,7 +93,7 @@ public class SpringRelativeLayout extends RelativeLayout { invalidate(); } - protected void onRelease() { + public void onRelease() { mEdgeGlowBottom.onRelease(); }