Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7df816a authored by Alex Chau's avatar Alex Chau
Browse files

Check showAsGrid when applying secondary translate on TaskViewSimulator

Bug: 184566209
Test: manual
Change-Id: I53d78553a67c8cd056a9cafad0f163e2c6401550
parent 01b5d5e3
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -180,9 +180,9 @@ public final class TaskViewUtils {
        int taskIndex = recentsView.indexOfChild(v);
        Context context = v.getContext();
        DeviceProfile dp = BaseActivity.fromContext(context).getDeviceProfile();
        boolean showAsGrid = dp.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get();
        boolean parallaxCenterAndAdjacentTask =
                taskIndex != recentsView.getCurrentPage() && !(dp.isTablet
                        && FeatureFlags.ENABLE_OVERVIEW_GRID.get());
                taskIndex != recentsView.getCurrentPage() && !showAsGrid;
        float gridTranslationSecondary = recentsView.getGridTranslationSecondary(taskIndex);
        int startScroll = recentsView.getScrollOffset(taskIndex);

@@ -200,7 +200,9 @@ public final class TaskViewUtils {
            tsv.setPreview(targets.apps[targets.apps.length - 1]);
            tsv.fullScreenProgress.value = 0;
            tsv.recentsViewScale.value = 1;
            if (showAsGrid) {
                tsv.taskSecondaryTranslation.value = gridTranslationSecondary;
            }
            tsv.setScroll(startScroll);

            // Fade in the task during the initial 20% of the animation
@@ -213,8 +215,10 @@ public final class TaskViewUtils {
                    AnimatedFloat.VALUE, 1, TOUCH_RESPONSE_INTERPOLATOR);
            out.setFloat(tsv.recentsViewScale,
                    AnimatedFloat.VALUE, tsv.getFullScreenScale(), TOUCH_RESPONSE_INTERPOLATOR);
            if (showAsGrid) {
                out.setFloat(tsv.taskSecondaryTranslation, AnimatedFloat.VALUE, 0,
                        TOUCH_RESPONSE_INTERPOLATOR_ACCEL_DEACCEL);
            }
            out.setFloat(tsv.recentsViewScroll, AnimatedFloat.VALUE, 0,
                    TOUCH_RESPONSE_INTERPOLATOR);