From 956b5f70122d9dcbd09175d6e6b0ecbc3e8527b5 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Tue, 9 Mar 2021 11:07:39 +0000 Subject: [PATCH] Use gridProgress from RecentsView when launching apps from overview Test: Launch from overview into app, animation should be smooth Bug: 174464863 Fixes: 182168668 Change-Id: I274ec55aaef1c30c973b8c37de3c6ddae43ff90f --- quickstep/src/com/android/quickstep/TaskViewUtils.java | 3 ++- .../src/com/android/quickstep/views/RecentsView.java | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index 17822e6f0c..aa1b8e19bb 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -180,6 +180,7 @@ public final class TaskViewUtils { boolean parallaxCenterAndAdjacentTask = taskIndex != recentsView.getCurrentPage() && !(dp.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get()); + float gridProgress = recentsView.getGridProgress(); float gridTranslationSecondary = recentsView.getGridTranslationSecondary(taskIndex); int startScroll = recentsView.getScrollOffset(taskIndex); @@ -197,7 +198,7 @@ public final class TaskViewUtils { tsv.setPreview(targets.apps[targets.apps.length - 1]); tsv.fullScreenProgress.value = 0; tsv.recentsViewScale.value = 1; - tsv.gridProgress.value = 1; + tsv.gridProgress.value = gridProgress; tsv.gridTranslationSecondary.value = gridTranslationSecondary; tsv.setScroll(startScroll); diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index bdd0a3678e..efe1f753e0 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -2773,6 +2773,15 @@ public abstract class RecentsView extends PagedView taskView.getGridTranslationY()); } + /** + * Returns the progress of forming a grid from carousel. + * + * @return A float from 0 to 1 where 0 is a carousel and 1 is a 2 row grid. + */ + public float getGridProgress() { + return mGridProgress; + } + public Consumer getEventDispatcher(float navbarRotation) { float degreesRotated; if (navbarRotation == 0) {