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

Commit 0b828e29 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias Committed by Android (Google) Code Review
Browse files

Merge "Finish recents animation to the matching state." into tm-qpr-dev

parents 82e112c2 146b86fc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -868,6 +868,10 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        btv.post(() -> mControllers.taskbarPopupController.showForIcon(btv));
    }

    public boolean isInApp() {
        return mControllers.taskbarStashController.isInApp();
    }

    protected void dumpLogs(String prefix, PrintWriter pw) {
        pw.println(prefix + "TaskbarActivityContext:");

+2 −1
Original line number Diff line number Diff line
@@ -462,7 +462,8 @@ public class TouchInteractionService extends Service
        mOverviewComponentObserver = new OverviewComponentObserver(this, mDeviceState);
        mOverviewCommandHelper = new OverviewCommandHelper(this,
                mOverviewComponentObserver, mTaskAnimationManager);
        mResetGestureInputConsumer = new ResetGestureInputConsumer(mTaskAnimationManager);
        mResetGestureInputConsumer = new ResetGestureInputConsumer(
                mTaskAnimationManager, mTaskbarManager::getCurrentActivityContext);
        mInputConsumer = InputConsumerController.getRecentsAnimationInputConsumer();
        mInputConsumer.registerInputConsumer();
        onSystemUiFlagsChanged(mDeviceState.getSystemUiStateFlags());
+11 −2
Original line number Diff line number Diff line
@@ -17,18 +17,25 @@ package com.android.quickstep.inputconsumers;

import android.view.MotionEvent;

import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.quickstep.InputConsumer;
import com.android.quickstep.TaskAnimationManager;

import java.util.function.Supplier;

/**
 * A NO_OP input consumer which also resets any pending gesture
 */
public class ResetGestureInputConsumer implements InputConsumer {

    private final TaskAnimationManager mTaskAnimationManager;
    private final Supplier<TaskbarActivityContext> mActivityContextSupplier;

    public ResetGestureInputConsumer(TaskAnimationManager taskAnimationManager) {
    public ResetGestureInputConsumer(
            TaskAnimationManager taskAnimationManager,
            Supplier<TaskbarActivityContext> activityContextSupplier) {
        mTaskAnimationManager = taskAnimationManager;
        mActivityContextSupplier = activityContextSupplier;
    }

    @Override
@@ -40,7 +47,9 @@ public class ResetGestureInputConsumer implements InputConsumer {
    public void onMotionEvent(MotionEvent ev) {
        if (ev.getAction() == MotionEvent.ACTION_DOWN
                && mTaskAnimationManager.isRecentsAnimationRunning()) {
            mTaskAnimationManager.finishRunningRecentsAnimation(false /* toHome */);
            TaskbarActivityContext tac = mActivityContextSupplier.get();
            mTaskAnimationManager.finishRunningRecentsAnimation(
                    /* toHome= */ tac != null && !tac.isInApp());
        }
    }
}