Refactor TaskViewTouchController to separately handle dismiss and launch.

Remove use of PendingAnimation for task dismiss.

Fix: 389080698
Test: Manual.
Flag: com.android.launcher3.enable_expressive_dismiss_task_motion
Change-Id: Ifdfd7d8ef78bba5d10ff6f157635430637805584
This commit is contained in:
Pat Manning committed 2025-02-03 19:46:52 +00:00
1 parent 1706f3db11
commit c824545d07
12 files changed
+536 -403

No files matched your search

@@ -21,8 +21,9 @@ import android.content.Context;
import android.util.AttributeSet;
import com.android.launcher3.statemanager.StatefulContainer;
import com.android.launcher3.uioverrides.touchcontrollers.TaskViewDismissTouchController;
import com.android.launcher3.uioverrides.touchcontrollers.TaskViewLaunchTouchController;
import com.android.launcher3.uioverrides.touchcontrollers.TaskViewRecentsTouchContext;
import com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchController;
import com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchControllerDeprecated;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.views.BaseDragLayer;
@@ -54,10 +55,18 @@ public class RecentsDragLayer<T extends Context & RecentsViewContainer
@Override
public void recreateControllers() {
mControllers = new TouchController[]{
enableExpressiveDismissTaskMotion() ? new TaskViewTouchController<>(mContainer,
mTaskViewRecentsTouchContext) : new TaskViewTouchControllerDeprecated<>(
mContainer, mTaskViewRecentsTouchContext),
new FallbackNavBarTouchController(mContainer)};
mControllers = enableExpressiveDismissTaskMotion()
? new TouchController[]{
new TaskViewLaunchTouchController<>(mContainer,
mTaskViewRecentsTouchContext),
new TaskViewDismissTouchController<>(mContainer,
mTaskViewRecentsTouchContext),
new FallbackNavBarTouchController(mContainer)
}
: new TouchController[]{
new TaskViewTouchControllerDeprecated<>(mContainer,
mTaskViewRecentsTouchContext),
new FallbackNavBarTouchController(mContainer)
};
}
}