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

Commit 44ffd922 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Fixing issue with animations not being cancelled." into nyc-dev

parents 839ff816 73492c5d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -22,6 +22,9 @@
    <!-- Standard notification gravity -->
    <integer name="notification_panel_layout_gravity">@integer/standard_notification_panel_layout_gravity</integer>

    <!-- The size of the initial peek area at the bottom of the stack (above the nav bar). -->
    <dimen name="recents_initial_bottom_peek_size">@dimen/recents_task_bar_height</dimen>

    <dimen name="docked_divider_handle_width">2dp</dimen>
    <dimen name="docked_divider_handle_height">16dp</dimen>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -99,6 +99,9 @@
    <!-- The top padding for the task stack. -->
    <dimen name="recents_stack_top_padding">40dp</dimen>

    <!-- The size of the initial peek area at the bottom of the stack (above the nav bar). -->
    <dimen name="recents_initial_bottom_peek_size">100dp</dimen>

    <!-- The side padding for the task stack. -->
    <dimen name="recents_stack_left_right_padding">64dp</dimen>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -295,6 +295,9 @@
    <!-- The size of the initial peek area at the top of the stack (below the status bar). -->
    <dimen name="recents_initial_top_peek_size">8dp</dimen>

    <!-- The size of the initial peek area at the bottom of the stack (above the nav bar). -->
    <dimen name="recents_initial_bottom_peek_size">100dp</dimen>

    <!-- The size of the peek area at the top of the stack (below the status bar). -->
    <dimen name="recents_layout_focused_top_peek_size">@dimen/recents_history_button_height</dimen>

+7 −7
Original line number Diff line number Diff line
@@ -431,13 +431,6 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD

        mIgnoreAltTabRelease = false;
        mIterateTrigger.stopDozing();

        // Workaround for b/22542869, if the RecentsActivity is started again, but without going
        // through SystemUI, we need to reset the config launch flags to ensure that we do not
        // wait on the system to send a signal that was never queued.
        RecentsConfiguration config = Recents.getConfiguration();
        RecentsActivityLaunchState launchState = config.getLaunchState();
        launchState.reset();
    }

    @Override
@@ -453,6 +446,13 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
        mIsVisible = false;
        EventBus.getDefault().send(new RecentsVisibilityChangedEvent(this, false));
        MetricsLogger.hidden(this, MetricsEvent.OVERVIEW_ACTIVITY);

        // Workaround for b/22542869, if the RecentsActivity is started again, but without going
        // through SystemUI, we need to reset the config launch flags to ensure that we do not
        // wait on the system to send a signal that was never queued.
        RecentsConfiguration config = Recents.getConfiguration();
        RecentsActivityLaunchState launchState = config.getLaunchState();
        launchState.reset();
    }

    @Override
+16 −8
Original line number Diff line number Diff line
@@ -105,6 +105,9 @@ public class RecentsTransitionHelper {
            animStartedListener = new ActivityOptions.OnAnimationStartedListener() {
                @Override
                public void onAnimationStarted() {
                    // If we are launching into another task, cancel the previous task's
                    // window transition
                    EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(task));
                    EventBus.getDefault().send(new ExitRecentsWindowFirstAnimationFrameEvent());

                    if (screenPinningRequested) {
@@ -119,6 +122,9 @@ public class RecentsTransitionHelper {
            animStartedListener = new ActivityOptions.OnAnimationStartedListener() {
                @Override
                public void onAnimationStarted() {
                    // If we are launching into another task, cancel the previous task's
                    // window transition
                    EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(task));
                    EventBus.getDefault().send(new ExitRecentsWindowFirstAnimationFrameEvent());
                }
            };
@@ -146,10 +152,6 @@ public class RecentsTransitionHelper {
                        animStartedListener);
            }
        }

        // If we are launching into another task, cancel the previous task's
        // window transition
        EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(task));
    }

    /**
@@ -278,7 +280,8 @@ public class RecentsTransitionHelper {
            } else {
                layoutAlgorithm.getStackTransformScreenCoordinates(task, stackScroll, mTmpTransform,
                        null);
                specs.add(composeAnimationSpec(taskView, mTmpTransform, true /* addHeaderBitmap */));
                specs.add(composeAnimationSpec(stackView, taskView, mTmpTransform,
                        true /* addHeaderBitmap */));
            }
            return specs;
        }
@@ -299,7 +302,8 @@ public class RecentsTransitionHelper {
                } else {
                    layoutAlgorithm.getStackTransformScreenCoordinates(t, stackScroll,
                            mTmpTransform, null);
                    specs.add(composeAnimationSpec(tv, mTmpTransform, true /* addHeaderBitmap */));
                    specs.add(composeAnimationSpec(stackView, tv, mTmpTransform,
                            true /* addHeaderBitmap */));
                }
            }
        }
@@ -318,8 +322,8 @@ public class RecentsTransitionHelper {
    /**
     * Composes a single animation spec for the given {@link TaskView}
     */
    private static AppTransitionAnimationSpec composeAnimationSpec(TaskView taskView,
            TaskViewTransform transform, boolean addHeaderBitmap) {
    private static AppTransitionAnimationSpec composeAnimationSpec(TaskStackView stackView,
            TaskView taskView, TaskViewTransform transform, boolean addHeaderBitmap) {
        Bitmap b = null;
        if (addHeaderBitmap) {
            float scale = transform.scale;
@@ -341,6 +345,10 @@ public class RecentsTransitionHelper {

        Rect taskRect = new Rect();
        transform.rect.round(taskRect);
        if (stackView.getStack().getStackFrontMostTask(false /* includeFreeformTasks */) !=
                taskView.getTask()) {
            taskRect.bottom = 2 * Recents.getSystemServices().getDisplayRect().height();
        }
        return new AppTransitionAnimationSpec(taskView.getTask().key.id, b, taskRect);
    }
}
Loading