diff --git a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java
index 754782bd49..65cdcf06ba 100644
--- a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java
+++ b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java
@@ -53,14 +53,17 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory {
public static final int ERROR_PERMISSIONS = 1;
private static final String TAG = "TaskOverlayFactoryGo";
- // Empty constructor required for ResourceBasedOverride
- public TaskOverlayFactoryGo(Context context) {}
+ private AssistContentRequester mContentRequester;
+
+ public TaskOverlayFactoryGo(Context context) {
+ mContentRequester = new AssistContentRequester(context);
+ }
/**
* Create a new overlay instance for the given View
*/
public TaskOverlayGo createOverlay(TaskThumbnailView thumbnailView) {
- return new TaskOverlayGo(thumbnailView);
+ return new TaskOverlayGo(thumbnailView, mContentRequester);
}
/**
@@ -72,9 +75,12 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory {
private String mTaskPackageName;
private String mWebUrl;
private boolean mAssistPermissionsEnabled;
+ private AssistContentRequester mFactoryContentRequester;
- private TaskOverlayGo(TaskThumbnailView taskThumbnailView) {
+ private TaskOverlayGo(TaskThumbnailView taskThumbnailView,
+ AssistContentRequester assistContentRequester) {
super(taskThumbnailView);
+ mFactoryContentRequester = assistContentRequester;
}
/**
@@ -105,9 +111,7 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory {
}
int taskId = task.key.id;
- AssistContentRequester contentRequester =
- new AssistContentRequester(mApplicationContext);
- contentRequester.requestAssistContent(taskId, this::onAssistContentReceived);
+ mFactoryContentRequester.requestAssistContent(taskId, this::onAssistContentReceived);
}
/** Provide Assist Content to the overlay. */
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index dd63cfaa68..d9c33aeeee 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -45,8 +45,9 @@
2.25dp
- 1.75dp
- 0.75dp
+ 1.5dp
+ 1dp
+ 5dp16dp70dp
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index 34c08d6b2e..43d03b3cc6 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -1416,14 +1416,14 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
: APP_LAUNCH_ALPHA_DOWN_DURATION;
iconAlphaStart = hasSplashScreen && !hasDifferentAppIcon ? 0 : 1f;
- // TOOD: Share value from shell when available.
- final float windowIconSize = Utilities.pxFromSp(108, r.getDisplayMetrics());
+ final int windowIconSize = ResourceUtils.getDimenByName("starting_surface_icon_size",
+ r, 108);
cropCenterXStart = windowTargetBounds.centerX();
cropCenterYStart = windowTargetBounds.centerY();
- cropWidthStart = (int) windowIconSize;
- cropHeightStart = (int) windowIconSize;
+ cropWidthStart = windowIconSize;
+ cropHeightStart = windowIconSize;
cropWidthEnd = windowTargetBounds.width();
cropHeightEnd = windowTargetBounds.height();
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
index c6ea953aff..180af0bd9f 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
@@ -21,6 +21,7 @@ import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_BOTH
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
+import android.os.SystemClock;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.Interpolator;
@@ -72,6 +73,7 @@ public abstract class TaskViewTouchController
private float mProgressMultiplier;
private float mEndDisplacement;
private FlingBlockCheck mFlingBlockCheck = new FlingBlockCheck();
+ private Float mOverrideVelocity = null;
private TaskView mTaskBeingDragged;
@@ -268,6 +270,7 @@ public abstract class TaskViewTouchController
mCurrentAnimation.pause();
}
mFlingBlockCheck.unblockFling();
+ mOverrideVelocity = null;
}
@Override
@@ -283,19 +286,36 @@ public abstract class TaskViewTouchController
mFlingBlockCheck.onEvent();
}
- // Once halfway through task dismissal interpolation, switch from reversible dragging-task
- // animation to playing the remaining task translation animations
- if (mCurrentAnimation.getProgressFraction() < ANIMATION_PROGRESS_FRACTION_MIDPOINT) {
- // Halve the value as we are animating the drag across the full length for only the
- // first half of the progress
- mCurrentAnimation.setPlayFraction(
- Utilities.boundToRange(totalDisplacement * mProgressMultiplier / 2, 0, 1));
+ if (isGoingUp) {
+ if (mCurrentAnimation.getProgressFraction() < ANIMATION_PROGRESS_FRACTION_MIDPOINT) {
+ // Halve the value when dismissing, as we are animating the drag across the full
+ // length for only the first half of the progress
+ mCurrentAnimation.setPlayFraction(
+ Utilities.boundToRange(totalDisplacement * mProgressMultiplier / 2, 0, 1));
+ } else {
+ // Set mOverrideVelocity to control task dismiss velocity in onDragEnd
+ int velocityDimenId = R.dimen.default_task_dismiss_drag_velocity;
+ if (mRecentsView.showAsGrid()) {
+ if (mTaskBeingDragged.isFocusedTask()) {
+ velocityDimenId =
+ R.dimen.default_task_dismiss_drag_velocity_grid_focus_task;
+ } else {
+ velocityDimenId = R.dimen.default_task_dismiss_drag_velocity_grid;
+ }
+ }
+ mOverrideVelocity = -mTaskBeingDragged.getResources().getDimension(velocityDimenId);
+
+ // Once halfway through task dismissal interpolation, switch from reversible
+ // dragging-task animation to playing the remaining task translation animations
+ final long now = SystemClock.uptimeMillis();
+ MotionEvent upAction = MotionEvent.obtain(now, now,
+ MotionEvent.ACTION_UP, 0.0f, 0.0f, 0);
+ mDetector.onTouchEvent(upAction);
+ upAction.recycle();
+ }
} else {
- float dragVelocity = -mTaskBeingDragged.getResources().getDimension(
- mRecentsView.showAsGrid() ? R.dimen.default_task_dismiss_drag_velocity_grid
- : R.dimen.default_task_dismiss_drag_velocity);
- onDragEnd(dragVelocity);
- return true;
+ mCurrentAnimation.setPlayFraction(
+ Utilities.boundToRange(totalDisplacement * mProgressMultiplier, 0, 1));
}
return true;
@@ -303,6 +323,10 @@ public abstract class TaskViewTouchController
@Override
public void onDragEnd(float velocity) {
+ if (mOverrideVelocity != null) {
+ velocity = mOverrideVelocity;
+ mOverrideVelocity = null;
+ }
// Limit velocity, as very large scalar values make animations play too quickly
float maxTaskDismissDragVelocity = mTaskBeingDragged.getResources().getDimension(
R.dimen.max_task_dismiss_drag_velocity);
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index be927e0107..306032cff2 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -972,6 +972,10 @@ public abstract class AbsSwipeUpHandler,
}
if (endTarget == HOME) {
duration = HOME_DURATION;
+ // Early detach the nav bar once the endTarget is determined as HOME
+ if (mRecentsAnimationController != null) {
+ mRecentsAnimationController.detachNavigationBarFromApp(true);
+ }
} else if (endTarget == RECENTS) {
if (mRecentsView != null) {
int nearestPage = mRecentsView.getDestinationPage();
@@ -1496,7 +1500,7 @@ public abstract class AbsSwipeUpHandler,
if (LIVE_TILE.get()) {
mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED);
if (mRecentsAnimationController != null) {
- mRecentsAnimationController.getController().detachNavigationBarFromApp(true);
+ mRecentsAnimationController.detachNavigationBarFromApp(true);
}
} else if (!hasTargets() || mRecentsAnimationController == null) {
// If there are no targets or the animation not started, then there is nothing to finish
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationController.java b/quickstep/src/com/android/quickstep/RecentsAnimationController.java
index 462f71440c..50d0569cf2 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationController.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationController.java
@@ -154,6 +154,14 @@ public class RecentsAnimationController {
});
}
+ /**
+ * @see RecentsAnimationControllerCompat#detachNavigationBarFromApp
+ */
+ @UiThread
+ public void detachNavigationBarFromApp(boolean moveHomeToTop) {
+ UI_HELPER_EXECUTOR.execute(() -> mController.detachNavigationBarFromApp(moveHomeToTop));
+ }
+
/**
* Sets the final surface transaction on a Task. This is used by Launcher to notify the system
* that animating Activity to PiP has completed and the associated task surface should be
diff --git a/quickstep/src/com/android/quickstep/util/AssistContentRequester.java b/quickstep/src/com/android/quickstep/util/AssistContentRequester.java
index 71c6382323..b1e38ebcbb 100644
--- a/quickstep/src/com/android/quickstep/util/AssistContentRequester.java
+++ b/quickstep/src/com/android/quickstep/util/AssistContentRequester.java
@@ -54,6 +54,7 @@ public class AssistContentRequester {
private final IActivityTaskManager mActivityTaskManager;
private final String mPackageName;
private final Executor mCallbackExecutor;
+ private final Executor mSystemInteractionExecutor;
// If system loses the callback, our internal cache of original callback will also get cleared.
private final Map