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

Commit 805578d8 authored by Winson's avatar Winson Committed by Winson Chung
Browse files

Fixing animation jump when dismissing paged task.

Change-Id: Ida07053da59f14f8ef3820e48a7bc73eef15840f
parent 17b2da4f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.systemui.recents.events.component;

import android.content.Context;
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.misc.SystemServicesProxy;

/**
 * This is sent when we want to start screen pinning.
+0 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.systemui.recents.views;

import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.ActivityManager.StackId;
import android.app.ActivityOptions;
import android.content.Context;
@@ -49,7 +48,6 @@ import com.android.systemui.recents.model.TaskStack;
import java.util.ArrayList;
import java.util.List;

import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
+0 −3
Original line number Diff line number Diff line
@@ -23,15 +23,12 @@ import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.util.ArraySet;
import android.util.AttributeSet;
import android.view.AppTransitionAnimationSpec;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowInsets;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.FrameLayout;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.logging.MetricsLogger;
import com.android.systemui.R;
import com.android.systemui.recents.Recents;
+16 −19
Original line number Diff line number Diff line
@@ -1117,9 +1117,12 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
        mLayersDisabled = false;

        // Draw the freeform workspace background
        SystemServicesProxy ssp = Recents.getSystemServices();
        if (ssp.hasFreeformWorkspaceSupport()) {
            if (mFreeformWorkspaceBackground.getAlpha() > 0) {
                mFreeformWorkspaceBackground.draw(canvas);
            }
        }

        super.dispatchDraw(canvas);
    }
@@ -1162,8 +1165,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
                mViewPool.returnViewToPool(tv);
            }

            // Get the stack scroll of the task to anchor to (since we are removing something, the front
            // most task will be our anchor task)
            // Get the stack scroll of the task to anchor to (since we are removing something, the
            // front most task will be our anchor task)
            Task anchorTask = null;
            float prevAnchorTaskScroll = 0;
            boolean pullStackForward = stack.getTaskCount() > 0;
@@ -1180,11 +1183,16 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
                // to ensure that the new front most task is now fully visible
                mStackScroller.setStackScroll(mLayoutAlgorithm.mMaxScrollP);
            } else if (pullStackForward) {
                // Otherwise, offset the scroll by half the movement of the anchor task to allow the
                // tasks behind the removed task to move forward, and the tasks in front to move back
                // Otherwise, offset the scroll by the movement of the anchor task
                float anchorTaskScroll = mLayoutAlgorithm.getStackScrollForTask(anchorTask);
                mStackScroller.setStackScroll(mStackScroller.getStackScroll() + (anchorTaskScroll
                        - prevAnchorTaskScroll) / 2);
                float newStackScroll = mStackScroller.getStackScroll() +
                        (anchorTaskScroll - prevAnchorTaskScroll);
                if (mLayoutAlgorithm.getFocusState() != TaskStackLayoutAlgorithm.STATE_FOCUSED) {
                    // If we are focused, we don't want the front task to move, but otherwise, we
                    // allow the back task to move up, and the front task to move back
                    newStackScroll /= 2;
                }
                mStackScroller.setStackScroll(newStackScroll);
                mStackScroller.boundScroll();
            }

@@ -1507,16 +1515,5 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal

        // Remove the task from the stack
        mStack.removeTask(task);

        if (taskWasFocused || ssp.isTouchExplorationEnabled()) {
            // If the dismissed task was focused or if we are in touch exploration mode, then focus
            // the next task
            RecentsConfiguration config = Recents.getConfiguration();
            RecentsActivityLaunchState launchState = config.getLaunchState();
            boolean isFreeformTask = taskIndex > 0 ?
                    mStack.getTasks().get(taskIndex - 1).isFreeformTask() : false;
            setFocusedTask(taskIndex - 1, !isFreeformTask /* scrollToTask */,
                    launchState.launchedWithAltTab);
        }
    }
}
+0 −5
Original line number Diff line number Diff line
@@ -16,12 +16,7 @@

package com.android.systemui.recents.views;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Canvas;