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

Commit b8f7d9a3 authored by Tony's avatar Tony
Browse files

Small updates for recents launch animation

- Increase translation x of adjacnet tasks, in order to maintain
  gaps between pages
- Fix parallax when launching side task (used to be based on launched
  task's translation, but now that is 0 since there's no curve)

Change-Id: Iace47761a6e0a69982cf2eac34436b7164e60792
parent 38f4ab17
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
    <!-- Launcher app transition -->
    <dimen name="content_trans_y">25dp</dimen>
    <dimen name="workspace_trans_y">80dp</dimen>
    <dimen name="recents_adjacent_trans_x">120dp</dimen>
    <dimen name="recents_adjacent_trans_x">140dp</dimen>
    <dimen name="recents_adjacent_trans_y">80dp</dimen>
    <fraction name="recents_adjacent_scale">150%</fraction>
</resources>
+6 −8
Original line number Diff line number Diff line
@@ -320,26 +320,24 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
        } else {
            // We are launching an adjacent task, so parallax the center and other adjacent task.
            TaskView centerTask = (TaskView) recentsView.getPageAt(centerTaskIndex);
            float translationX = Math.abs(v.getTranslationX());
            ObjectAnimator centerTaskParallaxToRight =
            float translationX = mRecentsTransX / 2;
            ObjectAnimator centerTaskParallaxOffscreen =
                    LauncherAnimUtils.ofPropertyValuesHolder(centerTask,
                            new PropertyListBuilder()
                                    .scale(v.getScaleX())
                                    .translationX(isRtl ? -translationX : translationX)
                                    .build());
            launcherAnimator.play(centerTaskParallaxToRight);
            launcherAnimator.play(centerTaskParallaxOffscreen);
            int otherAdjacentTaskIndex = centerTaskIndex + (centerTaskIndex - launchedTaskIndex);
            if (otherAdjacentTaskIndex >= 0
                    && otherAdjacentTaskIndex < recentsView.getPageCount()) {
                TaskView otherAdjacentTask = (TaskView) recentsView.getPageAt(
                        otherAdjacentTaskIndex);
                ObjectAnimator otherAdjacentTaskParallaxToRight =
                ObjectAnimator otherAdjacentTaskParallaxOffscreen =
                        LauncherAnimUtils.ofPropertyValuesHolder(otherAdjacentTask,
                                new PropertyListBuilder()
                                        .translationX(otherAdjacentTask.getTranslationX()
                                                + (isRtl ? -translationX : translationX))
                                        .translationX(isRtl ? -translationX : translationX)
                                        .build());
                launcherAnimator.play(otherAdjacentTaskParallaxToRight);
                launcherAnimator.play(otherAdjacentTaskParallaxOffscreen);
            }
        }