Merge "Use gridProgress from RecentsView when launching apps from overview" into sc-dev

This commit is contained in:
Alex Chau authored and Android (Google) Code Review committed 2021-03-10 20:14:25 +00:00
commit 7086256ac9
2 files changed
+11 -1

No files matched your search

@@ -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);
@@ -2773,6 +2773,15 @@ public abstract class RecentsView<T extends StatefulActivity> 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<MotionEvent> getEventDispatcher(float navbarRotation) {
float degreesRotated;
if (navbarRotation == 0) {