7/ Rename RecentsAnimationWrapper
- Move the recents animation classes out of util into base quickstep pkg - Clean up some local var names Bug: 141886704 Change-Id: I1556179e203cbb43b77ea58e6fe520aa9944099b
This commit is contained in:
parent
9e876a34ee
commit
d3da92ac66
|
@ -32,7 +32,6 @@ import android.util.Log;
|
||||||
import com.android.launcher3.BaseDraggingActivity;
|
import com.android.launcher3.BaseDraggingActivity;
|
||||||
import com.android.launcher3.LauncherAnimationRunner;
|
import com.android.launcher3.LauncherAnimationRunner;
|
||||||
import com.android.quickstep.util.RemoteAnimationProvider;
|
import com.android.quickstep.util.RemoteAnimationProvider;
|
||||||
import com.android.quickstep.util.RemoteAnimationTargets;
|
|
||||||
import com.android.quickstep.views.IconRecentsView;
|
import com.android.quickstep.views.IconRecentsView;
|
||||||
import com.android.systemui.shared.system.ActivityOptionsCompat;
|
import com.android.systemui.shared.system.ActivityOptionsCompat;
|
||||||
import com.android.systemui.shared.system.RemoteAnimationAdapterCompat;
|
import com.android.systemui.shared.system.RemoteAnimationAdapterCompat;
|
||||||
|
@ -113,9 +112,9 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
|
||||||
return anim;
|
return anim;
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteAnimationTargets targetSet =
|
RemoteAnimationTargets targets =
|
||||||
new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_CLOSING);
|
new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_CLOSING);
|
||||||
mRecentsView.setTransitionedFromApp(!targetSet.isAnimatingHome());
|
mRecentsView.setTransitionedFromApp(!targets.isAnimatingHome());
|
||||||
|
|
||||||
RemoteAnimationTargetCompat recentsTarget = null;
|
RemoteAnimationTargetCompat recentsTarget = null;
|
||||||
RemoteAnimationTargetCompat closingAppTarget = null;
|
RemoteAnimationTargetCompat closingAppTarget = null;
|
||||||
|
|
|
@ -27,7 +27,6 @@ import androidx.annotation.Nullable;
|
||||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||||
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
||||||
import com.android.quickstep.util.ActivityInitListener;
|
import com.android.quickstep.util.ActivityInitListener;
|
||||||
import com.android.quickstep.util.RemoteAnimationTargets;
|
|
||||||
import com.android.quickstep.views.IconRecentsView;
|
import com.android.quickstep.views.IconRecentsView;
|
||||||
|
|
||||||
import java.util.function.BiPredicate;
|
import java.util.function.BiPredicate;
|
||||||
|
|
|
@ -40,26 +40,28 @@ import com.android.systemui.shared.system.LatencyTrackerCompat;
|
||||||
public class OverviewCommandHelper {
|
public class OverviewCommandHelper {
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final ActivityManagerWrapper mAM;
|
private final RecentsAnimationDeviceState mDeviceState;
|
||||||
private final RecentsModel mRecentsModel;
|
private final RecentsModel mRecentsModel;
|
||||||
private final OverviewComponentObserver mOverviewComponentObserver;
|
private final OverviewComponentObserver mOverviewComponentObserver;
|
||||||
|
|
||||||
private long mLastToggleTime;
|
private long mLastToggleTime;
|
||||||
|
|
||||||
public OverviewCommandHelper(Context context, OverviewComponentObserver observer) {
|
public OverviewCommandHelper(Context context, RecentsAnimationDeviceState deviceState,
|
||||||
|
OverviewComponentObserver observer) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mAM = ActivityManagerWrapper.getInstance();
|
mDeviceState = deviceState;
|
||||||
mRecentsModel = RecentsModel.INSTANCE.get(mContext);
|
mRecentsModel = RecentsModel.INSTANCE.get(mContext);
|
||||||
mOverviewComponentObserver = observer;
|
mOverviewComponentObserver = observer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onOverviewToggle() {
|
public void onOverviewToggle() {
|
||||||
// If currently screen pinning, do not enter overview
|
// If currently screen pinning, do not enter overview
|
||||||
if (mAM.isScreenPinningActive()) {
|
if (mDeviceState.isScreenPinningActive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mAM.closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
|
ActivityManagerWrapper.getInstance()
|
||||||
|
.closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
|
||||||
MAIN_EXECUTOR.execute(new RecentsActivityCommand<>());
|
MAIN_EXECUTOR.execute(new RecentsActivityCommand<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ public class TouchInteractionService extends Service {
|
||||||
public void onUserUnlocked() {
|
public void onUserUnlocked() {
|
||||||
mRecentsModel = RecentsModel.INSTANCE.get(this);
|
mRecentsModel = RecentsModel.INSTANCE.get(this);
|
||||||
mOverviewComponentObserver = new OverviewComponentObserver(this, mDeviceState);
|
mOverviewComponentObserver = new OverviewComponentObserver(this, mDeviceState);
|
||||||
mOverviewCommandHelper = new OverviewCommandHelper(this,
|
mOverviewCommandHelper = new OverviewCommandHelper(this, mDeviceState,
|
||||||
mOverviewComponentObserver);
|
mOverviewComponentObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ import com.android.launcher3.BaseDraggingActivity;
|
||||||
import com.android.launcher3.anim.AnimationSuccessListener;
|
import com.android.launcher3.anim.AnimationSuccessListener;
|
||||||
import com.android.quickstep.util.AppWindowAnimationHelper;
|
import com.android.quickstep.util.AppWindowAnimationHelper;
|
||||||
import com.android.quickstep.util.RemoteAnimationProvider;
|
import com.android.quickstep.util.RemoteAnimationProvider;
|
||||||
import com.android.quickstep.util.RemoteAnimationTargets;
|
|
||||||
import com.android.quickstep.views.RecentsView;
|
import com.android.quickstep.views.RecentsView;
|
||||||
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
||||||
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat;
|
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat;
|
||||||
|
@ -115,11 +114,11 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
|
||||||
return anim;
|
return anim;
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteAnimationTargets targetSet = new RemoteAnimationTargets(appTargets,
|
RemoteAnimationTargets targets = new RemoteAnimationTargets(appTargets,
|
||||||
wallpaperTargets, MODE_CLOSING);
|
wallpaperTargets, MODE_CLOSING);
|
||||||
|
|
||||||
// Use the top closing app to determine the insets for the animation
|
// Use the top closing app to determine the insets for the animation
|
||||||
RemoteAnimationTargetCompat runningTaskTarget = targetSet.findTask(mTargetTaskId);
|
RemoteAnimationTargetCompat runningTaskTarget = targets.findTask(mTargetTaskId);
|
||||||
if (runningTaskTarget == null) {
|
if (runningTaskTarget == null) {
|
||||||
Log.e(TAG, "No closing app");
|
Log.e(TAG, "No closing app");
|
||||||
anim.play(ValueAnimator.ofInt(0, 1).setDuration(RECENTS_LAUNCH_DURATION));
|
anim.play(ValueAnimator.ofInt(0, 1).setDuration(RECENTS_LAUNCH_DURATION));
|
||||||
|
@ -149,12 +148,12 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
|
||||||
valueAnimator.setInterpolator(TOUCH_RESPONSE_INTERPOLATOR);
|
valueAnimator.setInterpolator(TOUCH_RESPONSE_INTERPOLATOR);
|
||||||
valueAnimator.addUpdateListener((v) -> {
|
valueAnimator.addUpdateListener((v) -> {
|
||||||
params.setProgress((float) v.getAnimatedValue())
|
params.setProgress((float) v.getAnimatedValue())
|
||||||
.setTargetSet(targetSet)
|
.setTargetSet(targets)
|
||||||
.setLauncherOnTop(true);
|
.setLauncherOnTop(true);
|
||||||
clipHelper.applyTransform(params);
|
clipHelper.applyTransform(params);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (targetSet.isAnimatingHome()) {
|
if (targets.isAnimatingHome()) {
|
||||||
// If we are animating home, fade in the opening targets
|
// If we are animating home, fade in the opening targets
|
||||||
RemoteAnimationTargets openingSet = new RemoteAnimationTargets(appTargets,
|
RemoteAnimationTargets openingSet = new RemoteAnimationTargets(appTargets,
|
||||||
wallpaperTargets, MODE_OPENING);
|
wallpaperTargets, MODE_OPENING);
|
||||||
|
|
|
@ -58,14 +58,12 @@ import com.android.launcher3.graphics.RotationMode;
|
||||||
import com.android.launcher3.views.FloatingIconView;
|
import com.android.launcher3.views.FloatingIconView;
|
||||||
import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory;
|
import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory;
|
||||||
import com.android.quickstep.SysUINavigationMode.Mode;
|
import com.android.quickstep.SysUINavigationMode.Mode;
|
||||||
import com.android.quickstep.inputconsumers.InputConsumer;
|
|
||||||
import com.android.quickstep.util.ActiveGestureLog;
|
import com.android.quickstep.util.ActiveGestureLog;
|
||||||
import com.android.quickstep.util.ActivityInitListener;
|
import com.android.quickstep.util.ActivityInitListener;
|
||||||
import com.android.quickstep.util.AppWindowAnimationHelper;
|
import com.android.quickstep.util.AppWindowAnimationHelper;
|
||||||
import com.android.quickstep.util.AppWindowAnimationHelper.TransformParams;
|
import com.android.quickstep.util.AppWindowAnimationHelper.TransformParams;
|
||||||
import com.android.quickstep.util.RectFSpringAnim;
|
import com.android.quickstep.util.RectFSpringAnim;
|
||||||
import com.android.quickstep.util.RecentsAnimationTargets;
|
import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener;
|
||||||
import com.android.quickstep.util.RecentsAnimationCallbacks.RecentsAnimationListener;
|
|
||||||
import com.android.quickstep.views.RecentsView;
|
import com.android.quickstep.views.RecentsView;
|
||||||
import com.android.quickstep.views.TaskView;
|
import com.android.quickstep.views.TaskView;
|
||||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||||
|
@ -118,7 +116,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
|
||||||
protected final ActivityInitListener mActivityInitListener;
|
protected final ActivityInitListener mActivityInitListener;
|
||||||
protected final InputConsumerController mInputConsumer;
|
protected final InputConsumerController mInputConsumer;
|
||||||
|
|
||||||
protected RecentsAnimationWrapper mRecentsAnimationWrapper;
|
protected RecentsAnimationController mRecentsAnimationController;
|
||||||
protected RecentsAnimationTargets mRecentsAnimationTargets;
|
protected RecentsAnimationTargets mRecentsAnimationTargets;
|
||||||
|
|
||||||
// Callbacks to be made once the recents animation starts
|
// Callbacks to be made once the recents animation starts
|
||||||
|
@ -227,7 +225,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
|
||||||
});
|
});
|
||||||
mRecentsView.setAppWindowAnimationHelper(mAppWindowAnimationHelper);
|
mRecentsView.setAppWindowAnimationHelper(mAppWindowAnimationHelper);
|
||||||
runOnRecentsAnimationStart(() ->
|
runOnRecentsAnimationStart(() ->
|
||||||
mRecentsView.setRecentsAnimationTargets(mRecentsAnimationWrapper,
|
mRecentsView.setRecentsAnimationTargets(mRecentsAnimationController,
|
||||||
mRecentsAnimationTargets));
|
mRecentsAnimationTargets));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,7 +238,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
|
||||||
} else {
|
} else {
|
||||||
int taskId = mRecentsView.getNextPageTaskView().getTask().key.id;
|
int taskId = mRecentsView.getNextPageTaskView().getTask().key.id;
|
||||||
mFinishingRecentsAnimationForNewTaskId = taskId;
|
mFinishingRecentsAnimationForNewTaskId = taskId;
|
||||||
mRecentsAnimationWrapper.finish(true /* toRecents */, () -> {
|
mRecentsAnimationController.finish(true /* toRecents */, () -> {
|
||||||
if (!mCanceled) {
|
if (!mCanceled) {
|
||||||
TaskView nextTask = mRecentsView.getTaskView(taskId);
|
TaskView nextTask = mRecentsView.getTaskView(taskId);
|
||||||
if (nextTask != null) {
|
if (nextTask != null) {
|
||||||
|
@ -284,17 +282,17 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecentsAnimationStart(RecentsAnimationWrapper recentsAnimationController,
|
public void onRecentsAnimationStart(RecentsAnimationController recentsAnimationController,
|
||||||
RecentsAnimationTargets targetSet) {
|
RecentsAnimationTargets targets) {
|
||||||
mRecentsAnimationWrapper = recentsAnimationController;
|
mRecentsAnimationController = recentsAnimationController;
|
||||||
mRecentsAnimationTargets = targetSet;
|
mRecentsAnimationTargets = targets;
|
||||||
DeviceProfile dp = InvariantDeviceProfile.INSTANCE.get(mContext).getDeviceProfile(mContext);
|
DeviceProfile dp = InvariantDeviceProfile.INSTANCE.get(mContext).getDeviceProfile(mContext);
|
||||||
final Rect overviewStackBounds;
|
final Rect overviewStackBounds;
|
||||||
RemoteAnimationTargetCompat runningTaskTarget = targetSet.findTask(mRunningTaskId);
|
RemoteAnimationTargetCompat runningTaskTarget = targets.findTask(mRunningTaskId);
|
||||||
|
|
||||||
if (targetSet.minimizedHomeBounds != null && runningTaskTarget != null) {
|
if (targets.minimizedHomeBounds != null && runningTaskTarget != null) {
|
||||||
overviewStackBounds = mActivityControlHelper
|
overviewStackBounds = mActivityControlHelper
|
||||||
.getOverviewWindowBounds(targetSet.minimizedHomeBounds, runningTaskTarget);
|
.getOverviewWindowBounds(targets.minimizedHomeBounds, runningTaskTarget);
|
||||||
dp = dp.getMultiWindowProfile(mContext, new Point(
|
dp = dp.getMultiWindowProfile(mContext, new Point(
|
||||||
overviewStackBounds.width(), overviewStackBounds.height()));
|
overviewStackBounds.width(), overviewStackBounds.height()));
|
||||||
} else {
|
} else {
|
||||||
|
@ -302,7 +300,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
|
||||||
dp = dp.copy(mContext);
|
dp = dp.copy(mContext);
|
||||||
overviewStackBounds = getStackBounds(dp);
|
overviewStackBounds = getStackBounds(dp);
|
||||||
}
|
}
|
||||||
dp.updateInsets(targetSet.homeContentInsets);
|
dp.updateInsets(targets.homeContentInsets);
|
||||||
dp.updateIsSeascape(mContext);
|
dp.updateIsSeascape(mContext);
|
||||||
if (runningTaskTarget != null) {
|
if (runningTaskTarget != null) {
|
||||||
mAppWindowAnimationHelper.updateSource(overviewStackBounds, runningTaskTarget);
|
mAppWindowAnimationHelper.updateSource(overviewStackBounds, runningTaskTarget);
|
||||||
|
@ -322,13 +320,13 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) {
|
public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) {
|
||||||
mRecentsAnimationWrapper = null;
|
mRecentsAnimationController = null;
|
||||||
mRecentsAnimationTargets = null;
|
mRecentsAnimationTargets = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecentsAnimationFinished(RecentsAnimationWrapper controller) {
|
public void onRecentsAnimationFinished(RecentsAnimationController controller) {
|
||||||
mRecentsAnimationWrapper = null;
|
mRecentsAnimationController = null;
|
||||||
mRecentsAnimationTargets = null;
|
mRecentsAnimationTargets = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@ import com.android.launcher3.userevent.nano.LauncherLogProto;
|
||||||
import com.android.quickstep.fallback.FallbackRecentsView;
|
import com.android.quickstep.fallback.FallbackRecentsView;
|
||||||
import com.android.quickstep.util.ActivityInitListener;
|
import com.android.quickstep.util.ActivityInitListener;
|
||||||
import com.android.quickstep.util.LayoutUtils;
|
import com.android.quickstep.util.LayoutUtils;
|
||||||
import com.android.quickstep.util.RemoteAnimationTargets;
|
|
||||||
import com.android.quickstep.views.RecentsView;
|
import com.android.quickstep.views.RecentsView;
|
||||||
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ import android.os.Build;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.view.ViewConfiguration;
|
import android.view.ViewConfiguration;
|
||||||
|
|
||||||
|
import androidx.annotation.BinderThread;
|
||||||
import com.android.launcher3.BaseDraggingActivity;
|
import com.android.launcher3.BaseDraggingActivity;
|
||||||
import com.android.launcher3.logging.UserEventDispatcher;
|
import com.android.launcher3.logging.UserEventDispatcher;
|
||||||
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
||||||
|
@ -44,37 +45,43 @@ import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
||||||
public class OverviewCommandHelper {
|
public class OverviewCommandHelper {
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final ActivityManagerWrapper mAM;
|
private final RecentsAnimationDeviceState mDeviceState;
|
||||||
private final RecentsModel mRecentsModel;
|
private final RecentsModel mRecentsModel;
|
||||||
private final OverviewComponentObserver mOverviewComponentObserver;
|
private final OverviewComponentObserver mOverviewComponentObserver;
|
||||||
|
|
||||||
private long mLastToggleTime;
|
private long mLastToggleTime;
|
||||||
|
|
||||||
public OverviewCommandHelper(Context context, OverviewComponentObserver observer) {
|
public OverviewCommandHelper(Context context, RecentsAnimationDeviceState deviceState,
|
||||||
|
OverviewComponentObserver observer) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mAM = ActivityManagerWrapper.getInstance();
|
mDeviceState = deviceState;
|
||||||
mRecentsModel = RecentsModel.INSTANCE.get(mContext);
|
mRecentsModel = RecentsModel.INSTANCE.get(mContext);
|
||||||
mOverviewComponentObserver = observer;
|
mOverviewComponentObserver = observer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
public void onOverviewToggle() {
|
public void onOverviewToggle() {
|
||||||
// If currently screen pinning, do not enter overview
|
// If currently screen pinning, do not enter overview
|
||||||
if (mAM.isScreenPinningActive()) {
|
if (mDeviceState.isScreenPinningActive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mAM.closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
|
ActivityManagerWrapper.getInstance()
|
||||||
|
.closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
|
||||||
MAIN_EXECUTOR.execute(new RecentsActivityCommand<>());
|
MAIN_EXECUTOR.execute(new RecentsActivityCommand<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
public void onOverviewShown(boolean triggeredFromAltTab) {
|
public void onOverviewShown(boolean triggeredFromAltTab) {
|
||||||
MAIN_EXECUTOR.execute(new ShowRecentsCommand(triggeredFromAltTab));
|
MAIN_EXECUTOR.execute(new ShowRecentsCommand(triggeredFromAltTab));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
public void onOverviewHidden() {
|
public void onOverviewHidden() {
|
||||||
MAIN_EXECUTOR.execute(new HideRecentsCommand());
|
MAIN_EXECUTOR.execute(new HideRecentsCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
public void onTip(int actionType, int viewType) {
|
public void onTip(int actionType, int viewType) {
|
||||||
MAIN_EXECUTOR.execute(() ->
|
MAIN_EXECUTOR.execute(() ->
|
||||||
UserEventDispatcher.newInstance(mContext).logActionTip(actionType, viewType));
|
UserEventDispatcher.newInstance(mContext).logActionTip(actionType, viewType));
|
||||||
|
|
|
@ -22,9 +22,7 @@ import android.util.Log;
|
||||||
import com.android.launcher3.Utilities;
|
import com.android.launcher3.Utilities;
|
||||||
import com.android.launcher3.config.FeatureFlags;
|
import com.android.launcher3.config.FeatureFlags;
|
||||||
import com.android.launcher3.util.Preconditions;
|
import com.android.launcher3.util.Preconditions;
|
||||||
import com.android.quickstep.util.RecentsAnimationCallbacks;
|
import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener;
|
||||||
import com.android.quickstep.util.RecentsAnimationTargets;
|
|
||||||
import com.android.quickstep.util.RecentsAnimationCallbacks.RecentsAnimationListener;
|
|
||||||
|
|
||||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||||
|
|
||||||
|
@ -38,7 +36,7 @@ public class SwipeSharedState implements RecentsAnimationListener {
|
||||||
private OverviewComponentObserver mOverviewComponentObserver;
|
private OverviewComponentObserver mOverviewComponentObserver;
|
||||||
|
|
||||||
private RecentsAnimationCallbacks mRecentsAnimationListener;
|
private RecentsAnimationCallbacks mRecentsAnimationListener;
|
||||||
private RecentsAnimationWrapper mLastRecentsAnimationController;
|
private RecentsAnimationController mLastRecentsAnimationController;
|
||||||
private RecentsAnimationTargets mLastAnimationTarget;
|
private RecentsAnimationTargets mLastAnimationTarget;
|
||||||
|
|
||||||
private boolean mLastAnimationCancelled = false;
|
private boolean mLastAnimationCancelled = false;
|
||||||
|
@ -55,10 +53,10 @@ public class SwipeSharedState implements RecentsAnimationListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void onRecentsAnimationStart(RecentsAnimationWrapper controller,
|
public final void onRecentsAnimationStart(RecentsAnimationController controller,
|
||||||
RecentsAnimationTargets targetSet) {
|
RecentsAnimationTargets targets) {
|
||||||
mLastRecentsAnimationController = controller;
|
mLastRecentsAnimationController = controller;
|
||||||
mLastAnimationTarget = targetSet;
|
mLastAnimationTarget = targets;
|
||||||
|
|
||||||
mLastAnimationCancelled = false;
|
mLastAnimationCancelled = false;
|
||||||
mLastAnimationRunning = true;
|
mLastAnimationRunning = true;
|
||||||
|
@ -78,7 +76,7 @@ public class SwipeSharedState implements RecentsAnimationListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void onRecentsAnimationFinished(RecentsAnimationWrapper controller) {
|
public final void onRecentsAnimationFinished(RecentsAnimationController controller) {
|
||||||
if (mLastRecentsAnimationController == controller) {
|
if (mLastRecentsAnimationController == controller) {
|
||||||
mLastAnimationRunning = false;
|
mLastAnimationRunning = false;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +115,7 @@ public class SwipeSharedState implements RecentsAnimationListener {
|
||||||
mLastAnimationRunning = false;
|
mLastAnimationRunning = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RecentsAnimationCallbacks newRecentsAnimationListenerSet() {
|
public RecentsAnimationCallbacks newRecentsAnimationCallbacks() {
|
||||||
Preconditions.assertUIThread();
|
Preconditions.assertUIThread();
|
||||||
|
|
||||||
if (mLastAnimationRunning) {
|
if (mLastAnimationRunning) {
|
||||||
|
|
|
@ -33,7 +33,6 @@ import com.android.launcher3.ItemInfo;
|
||||||
import com.android.launcher3.Utilities;
|
import com.android.launcher3.Utilities;
|
||||||
import com.android.quickstep.util.AppWindowAnimationHelper;
|
import com.android.quickstep.util.AppWindowAnimationHelper;
|
||||||
import com.android.quickstep.util.MultiValueUpdateListener;
|
import com.android.quickstep.util.MultiValueUpdateListener;
|
||||||
import com.android.quickstep.util.RemoteAnimationTargets;
|
|
||||||
import com.android.quickstep.views.RecentsView;
|
import com.android.quickstep.views.RecentsView;
|
||||||
import com.android.quickstep.views.TaskView;
|
import com.android.quickstep.views.TaskView;
|
||||||
import com.android.systemui.shared.recents.model.Task;
|
import com.android.systemui.shared.recents.model.Task;
|
||||||
|
@ -121,13 +120,13 @@ public final class TaskViewUtils {
|
||||||
RemoteAnimationTargetCompat[] wallpaperTargets, final AppWindowAnimationHelper inOutHelper) {
|
RemoteAnimationTargetCompat[] wallpaperTargets, final AppWindowAnimationHelper inOutHelper) {
|
||||||
SyncRtSurfaceTransactionApplierCompat applier =
|
SyncRtSurfaceTransactionApplierCompat applier =
|
||||||
new SyncRtSurfaceTransactionApplierCompat(v);
|
new SyncRtSurfaceTransactionApplierCompat(v);
|
||||||
final RemoteAnimationTargets targetSet =
|
final RemoteAnimationTargets targets =
|
||||||
new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_OPENING);
|
new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_OPENING);
|
||||||
targetSet.addDependentTransactionApplier(applier);
|
targets.addDependentTransactionApplier(applier);
|
||||||
AppWindowAnimationHelper.TransformParams params =
|
AppWindowAnimationHelper.TransformParams params =
|
||||||
new AppWindowAnimationHelper.TransformParams()
|
new AppWindowAnimationHelper.TransformParams()
|
||||||
.setSyncTransactionApplier(applier)
|
.setSyncTransactionApplier(applier)
|
||||||
.setTargetSet(targetSet)
|
.setTargetSet(targets)
|
||||||
.setLauncherOnTop(true);
|
.setLauncherOnTop(true);
|
||||||
|
|
||||||
final RecentsView recentsView = v.getRecentsView();
|
final RecentsView recentsView = v.getRecentsView();
|
||||||
|
@ -149,7 +148,7 @@ public final class TaskViewUtils {
|
||||||
BaseActivity.fromContext(v.getContext()).getDeviceProfile(),
|
BaseActivity.fromContext(v.getContext()).getDeviceProfile(),
|
||||||
true /* isOpening */);
|
true /* isOpening */);
|
||||||
inOutHelper.fromTaskThumbnailView(v.getThumbnail(), (RecentsView) v.getParent(),
|
inOutHelper.fromTaskThumbnailView(v.getThumbnail(), (RecentsView) v.getParent(),
|
||||||
targetSet.apps.length == 0 ? null : targetSet.apps[0]);
|
targets.apps.length == 0 ? null : targets.apps[0]);
|
||||||
|
|
||||||
mThumbnailRect = new RectF(inOutHelper.getTargetRect());
|
mThumbnailRect = new RectF(inOutHelper.getTargetRect());
|
||||||
mThumbnailRect.offset(-v.getTranslationX(), -v.getTranslationY());
|
mThumbnailRect.offset(-v.getTranslationX(), -v.getTranslationY());
|
||||||
|
@ -203,7 +202,7 @@ public final class TaskViewUtils {
|
||||||
appAnimator.addListener(new AnimatorListenerAdapter() {
|
appAnimator.addListener(new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
targetSet.release();
|
targets.release();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return appAnimator;
|
return appAnimator;
|
||||||
|
|
|
@ -48,6 +48,7 @@ import android.view.Choreographer;
|
||||||
import android.view.InputEvent;
|
import android.view.InputEvent;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
|
import androidx.annotation.BinderThread;
|
||||||
import androidx.annotation.UiThread;
|
import androidx.annotation.UiThread;
|
||||||
import androidx.annotation.WorkerThread;
|
import androidx.annotation.WorkerThread;
|
||||||
|
|
||||||
|
@ -66,7 +67,6 @@ import com.android.quickstep.inputconsumers.AccessibilityInputConsumer;
|
||||||
import com.android.quickstep.inputconsumers.AssistantInputConsumer;
|
import com.android.quickstep.inputconsumers.AssistantInputConsumer;
|
||||||
import com.android.quickstep.inputconsumers.DeviceLockedInputConsumer;
|
import com.android.quickstep.inputconsumers.DeviceLockedInputConsumer;
|
||||||
import com.android.quickstep.inputconsumers.FallbackNoButtonInputConsumer;
|
import com.android.quickstep.inputconsumers.FallbackNoButtonInputConsumer;
|
||||||
import com.android.quickstep.inputconsumers.InputConsumer;
|
|
||||||
import com.android.quickstep.inputconsumers.OtherActivityInputConsumer;
|
import com.android.quickstep.inputconsumers.OtherActivityInputConsumer;
|
||||||
import com.android.quickstep.inputconsumers.OverviewInputConsumer;
|
import com.android.quickstep.inputconsumers.OverviewInputConsumer;
|
||||||
import com.android.quickstep.inputconsumers.OverviewWithoutFocusInputConsumer;
|
import com.android.quickstep.inputconsumers.OverviewWithoutFocusInputConsumer;
|
||||||
|
@ -123,6 +123,7 @@ public class TouchInteractionService extends Service implements
|
||||||
|
|
||||||
private final IBinder mMyBinder = new IOverviewProxy.Stub() {
|
private final IBinder mMyBinder = new IOverviewProxy.Stub() {
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
public void onInitialize(Bundle bundle) {
|
public void onInitialize(Bundle bundle) {
|
||||||
ISystemUiProxy proxy = ISystemUiProxy.Stub.asInterface(
|
ISystemUiProxy proxy = ISystemUiProxy.Stub.asInterface(
|
||||||
bundle.getBinder(KEY_EXTRA_SYSUI_PROXY));
|
bundle.getBinder(KEY_EXTRA_SYSUI_PROXY));
|
||||||
|
@ -133,16 +134,19 @@ public class TouchInteractionService extends Service implements
|
||||||
sIsInitialized = true;
|
sIsInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
@Override
|
@Override
|
||||||
public void onOverviewToggle() {
|
public void onOverviewToggle() {
|
||||||
mOverviewCommandHelper.onOverviewToggle();
|
mOverviewCommandHelper.onOverviewToggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
@Override
|
@Override
|
||||||
public void onOverviewShown(boolean triggeredFromAltTab) {
|
public void onOverviewShown(boolean triggeredFromAltTab) {
|
||||||
mOverviewCommandHelper.onOverviewShown(triggeredFromAltTab);
|
mOverviewCommandHelper.onOverviewShown(triggeredFromAltTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
@Override
|
@Override
|
||||||
public void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) {
|
public void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) {
|
||||||
if (triggeredFromAltTab && !triggeredFromHomeKey) {
|
if (triggeredFromAltTab && !triggeredFromHomeKey) {
|
||||||
|
@ -151,23 +155,27 @@ public class TouchInteractionService extends Service implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
@Override
|
@Override
|
||||||
public void onTip(int actionType, int viewType) {
|
public void onTip(int actionType, int viewType) {
|
||||||
mOverviewCommandHelper.onTip(actionType, viewType);
|
mOverviewCommandHelper.onTip(actionType, viewType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
@Override
|
@Override
|
||||||
public void onAssistantAvailable(boolean available) {
|
public void onAssistantAvailable(boolean available) {
|
||||||
MAIN_EXECUTOR.execute(() -> mDeviceState.setAssistantAvailable(available));
|
MAIN_EXECUTOR.execute(() -> mDeviceState.setAssistantAvailable(available));
|
||||||
MAIN_EXECUTOR.execute(TouchInteractionService.this::onAssistantVisibilityChanged);
|
MAIN_EXECUTOR.execute(TouchInteractionService.this::onAssistantVisibilityChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
@Override
|
@Override
|
||||||
public void onAssistantVisibilityChanged(float visibility) {
|
public void onAssistantVisibilityChanged(float visibility) {
|
||||||
MAIN_EXECUTOR.execute(() -> mDeviceState.setAssistantVisibility(visibility));
|
MAIN_EXECUTOR.execute(() -> mDeviceState.setAssistantVisibility(visibility));
|
||||||
MAIN_EXECUTOR.execute(TouchInteractionService.this::onAssistantVisibilityChanged);
|
MAIN_EXECUTOR.execute(TouchInteractionService.this::onAssistantVisibilityChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
public void onBackAction(boolean completed, int downX, int downY, boolean isButton,
|
public void onBackAction(boolean completed, int downX, int downY, boolean isButton,
|
||||||
boolean gestureSwipeLeft) {
|
boolean gestureSwipeLeft) {
|
||||||
if (mOverviewComponentObserver == null) {
|
if (mOverviewComponentObserver == null) {
|
||||||
|
@ -184,11 +192,13 @@ public class TouchInteractionService extends Service implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
public void onSystemUiStateChanged(int stateFlags) {
|
public void onSystemUiStateChanged(int stateFlags) {
|
||||||
MAIN_EXECUTOR.execute(() -> mDeviceState.setSystemUiFlags(stateFlags));
|
MAIN_EXECUTOR.execute(() -> mDeviceState.setSystemUiFlags(stateFlags));
|
||||||
MAIN_EXECUTOR.execute(TouchInteractionService.this::onSystemUiFlagsChanged);
|
MAIN_EXECUTOR.execute(TouchInteractionService.this::onSystemUiFlagsChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BinderThread
|
||||||
public void onActiveNavBarRegionChanges(Region region) {
|
public void onActiveNavBarRegionChanges(Region region) {
|
||||||
MAIN_EXECUTOR.execute(() -> mDeviceState.setDeferredGestureRegion(region));
|
MAIN_EXECUTOR.execute(() -> mDeviceState.setDeferredGestureRegion(region));
|
||||||
}
|
}
|
||||||
|
@ -314,10 +324,12 @@ public class TouchInteractionService extends Service implements
|
||||||
resetHomeBounceSeenOnQuickstepEnabledFirstTime();
|
resetHomeBounceSeenOnQuickstepEnabledFirstTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UiThread
|
||||||
public void onUserUnlocked() {
|
public void onUserUnlocked() {
|
||||||
mRecentsModel = RecentsModel.INSTANCE.get(this);
|
mRecentsModel = RecentsModel.INSTANCE.get(this);
|
||||||
mOverviewComponentObserver = new OverviewComponentObserver(this, mDeviceState);
|
mOverviewComponentObserver = new OverviewComponentObserver(this, mDeviceState);
|
||||||
mOverviewCommandHelper = new OverviewCommandHelper(this, mOverviewComponentObserver);
|
mOverviewCommandHelper = new OverviewCommandHelper(this, mDeviceState,
|
||||||
|
mOverviewComponentObserver);
|
||||||
mInputConsumer = InputConsumerController.getRecentsAnimationInputConsumer();
|
mInputConsumer = InputConsumerController.getRecentsAnimationInputConsumer();
|
||||||
|
|
||||||
sSwipeSharedState.setOverviewComponentObserver(mOverviewComponentObserver);
|
sSwipeSharedState.setOverviewComponentObserver(mOverviewComponentObserver);
|
||||||
|
|
|
@ -75,12 +75,10 @@ import com.android.quickstep.ActivityControlHelper.AnimationFactory;
|
||||||
import com.android.quickstep.ActivityControlHelper.AnimationFactory.ShelfAnimState;
|
import com.android.quickstep.ActivityControlHelper.AnimationFactory.ShelfAnimState;
|
||||||
import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory;
|
import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory;
|
||||||
import com.android.quickstep.SysUINavigationMode.Mode;
|
import com.android.quickstep.SysUINavigationMode.Mode;
|
||||||
import com.android.quickstep.inputconsumers.InputConsumer;
|
|
||||||
import com.android.quickstep.inputconsumers.OverviewInputConsumer;
|
import com.android.quickstep.inputconsumers.OverviewInputConsumer;
|
||||||
import com.android.quickstep.util.ActiveGestureLog;
|
import com.android.quickstep.util.ActiveGestureLog;
|
||||||
import com.android.quickstep.util.AppWindowAnimationHelper.TargetAlphaProvider;
|
import com.android.quickstep.util.AppWindowAnimationHelper.TargetAlphaProvider;
|
||||||
import com.android.quickstep.util.RectFSpringAnim;
|
import com.android.quickstep.util.RectFSpringAnim;
|
||||||
import com.android.quickstep.util.RecentsAnimationTargets;
|
|
||||||
import com.android.quickstep.views.LiveTileOverlay;
|
import com.android.quickstep.views.LiveTileOverlay;
|
||||||
import com.android.quickstep.views.RecentsView;
|
import com.android.quickstep.views.RecentsView;
|
||||||
import com.android.quickstep.views.TaskView;
|
import com.android.quickstep.views.TaskView;
|
||||||
|
@ -594,8 +592,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
|
||||||
: centermostTask.getThumbnail().getSysUiStatusNavFlags();
|
: centermostTask.getThumbnail().getSysUiStatusNavFlags();
|
||||||
boolean useHomeScreenFlags = windowProgress > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD;
|
boolean useHomeScreenFlags = windowProgress > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD;
|
||||||
// We will handle the sysui flags based on the centermost task view.
|
// We will handle the sysui flags based on the centermost task view.
|
||||||
if (mRecentsAnimationWrapper != null) {
|
if (mRecentsAnimationController != null) {
|
||||||
mRecentsAnimationWrapper.setWindowThresholdCrossed(centermostTaskFlags != 0
|
mRecentsAnimationController.setWindowThresholdCrossed(centermostTaskFlags != 0
|
||||||
|| useHomeScreenFlags);
|
|| useHomeScreenFlags);
|
||||||
}
|
}
|
||||||
int sysuiFlags = useHomeScreenFlags ? 0 : centermostTaskFlags;
|
int sysuiFlags = useHomeScreenFlags ? 0 : centermostTaskFlags;
|
||||||
|
@ -604,14 +602,14 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecentsAnimationStart(RecentsAnimationWrapper controller,
|
public void onRecentsAnimationStart(RecentsAnimationController controller,
|
||||||
RecentsAnimationTargets targetSet) {
|
RecentsAnimationTargets targets) {
|
||||||
ActiveGestureLog.INSTANCE.addLog("startRecentsAnimationCallback", targetSet.apps.length);
|
ActiveGestureLog.INSTANCE.addLog("startRecentsAnimationCallback", targets.apps.length);
|
||||||
super.onRecentsAnimationStart(controller, targetSet);
|
super.onRecentsAnimationStart(controller, targets);
|
||||||
|
|
||||||
// Only add the callback to enable the input consumer after we actually have the controller
|
// Only add the callback to enable the input consumer after we actually have the controller
|
||||||
mStateCallback.addCallback(STATE_APP_CONTROLLER_RECEIVED | STATE_GESTURE_STARTED,
|
mStateCallback.addCallback(STATE_APP_CONTROLLER_RECEIVED | STATE_GESTURE_STARTED,
|
||||||
mRecentsAnimationWrapper::enableInputConsumer);
|
mRecentsAnimationController::enableInputConsumer);
|
||||||
setStateOnUiThread(STATE_APP_CONTROLLER_RECEIVED);
|
setStateOnUiThread(STATE_APP_CONTROLLER_RECEIVED);
|
||||||
|
|
||||||
mPassedOverviewThreshold = false;
|
mPassedOverviewThreshold = false;
|
||||||
|
@ -813,8 +811,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (endTarget.isLauncher && mRecentsAnimationWrapper != null) {
|
if (endTarget.isLauncher && mRecentsAnimationController != null) {
|
||||||
mRecentsAnimationWrapper.enableInputProxy(mInputConsumer,
|
mRecentsAnimationController.enableInputProxy(mInputConsumer,
|
||||||
this::createNewInputProxyHandler);
|
this::createNewInputProxyHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1022,7 +1020,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
|
||||||
|
|
||||||
@UiThread
|
@UiThread
|
||||||
private void resumeLastTask() {
|
private void resumeLastTask() {
|
||||||
mRecentsAnimationWrapper.finish(false /* toRecents */, null);
|
mRecentsAnimationController.finish(false /* toRecents */, null);
|
||||||
ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", false);
|
ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", false);
|
||||||
doLogGesture(LAST_TASK);
|
doLogGesture(LAST_TASK);
|
||||||
reset();
|
reset();
|
||||||
|
@ -1113,10 +1111,10 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
|
||||||
|
|
||||||
private void switchToScreenshot() {
|
private void switchToScreenshot() {
|
||||||
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
|
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
|
||||||
if (mRecentsAnimationWrapper != null) {
|
if (mRecentsAnimationController != null) {
|
||||||
// Update the screenshot of the task
|
// Update the screenshot of the task
|
||||||
if (mTaskSnapshot == null) {
|
if (mTaskSnapshot == null) {
|
||||||
mTaskSnapshot = mRecentsAnimationWrapper.screenshotTask(mRunningTaskId);
|
mTaskSnapshot = mRecentsAnimationController.screenshotTask(mRunningTaskId);
|
||||||
}
|
}
|
||||||
mRecentsView.updateThumbnail(mRunningTaskId, mTaskSnapshot, false /* refreshNow */);
|
mRecentsView.updateThumbnail(mRunningTaskId, mTaskSnapshot, false /* refreshNow */);
|
||||||
}
|
}
|
||||||
|
@ -1126,10 +1124,10 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
|
||||||
setStateOnUiThread(STATE_SCREENSHOT_CAPTURED);
|
setStateOnUiThread(STATE_SCREENSHOT_CAPTURED);
|
||||||
} else {
|
} else {
|
||||||
boolean finishTransitionPosted = false;
|
boolean finishTransitionPosted = false;
|
||||||
if (mRecentsAnimationWrapper != null) {
|
if (mRecentsAnimationController != null) {
|
||||||
// Update the screenshot of the task
|
// Update the screenshot of the task
|
||||||
if (mTaskSnapshot == null) {
|
if (mTaskSnapshot == null) {
|
||||||
mTaskSnapshot = mRecentsAnimationWrapper.screenshotTask(mRunningTaskId);
|
mTaskSnapshot = mRecentsAnimationController.screenshotTask(mRunningTaskId);
|
||||||
}
|
}
|
||||||
final TaskView taskView;
|
final TaskView taskView;
|
||||||
if (mGestureEndTarget == HOME) {
|
if (mGestureEndTarget == HOME) {
|
||||||
|
@ -1162,8 +1160,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
|
||||||
// If there are no targets, then there is nothing to finish
|
// If there are no targets, then there is nothing to finish
|
||||||
setStateOnUiThread(STATE_CURRENT_TASK_FINISHED);
|
setStateOnUiThread(STATE_CURRENT_TASK_FINISHED);
|
||||||
} else {
|
} else {
|
||||||
synchronized (mRecentsAnimationWrapper) {
|
synchronized (mRecentsAnimationController) {
|
||||||
mRecentsAnimationWrapper.finish(true /* toRecents */,
|
mRecentsAnimationController.finish(true /* toRecents */,
|
||||||
() -> setStateOnUiThread(STATE_CURRENT_TASK_FINISHED));
|
() -> setStateOnUiThread(STATE_CURRENT_TASK_FINISHED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1171,8 +1169,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
|
||||||
}
|
}
|
||||||
|
|
||||||
private void finishCurrentTransitionToHome() {
|
private void finishCurrentTransitionToHome() {
|
||||||
synchronized (mRecentsAnimationWrapper) {
|
synchronized (mRecentsAnimationController) {
|
||||||
mRecentsAnimationWrapper.finish(true /* toRecents */,
|
mRecentsAnimationController.finish(true /* toRecents */,
|
||||||
() -> setStateOnUiThread(STATE_CURRENT_TASK_FINISHED),
|
() -> setStateOnUiThread(STATE_CURRENT_TASK_FINISHED),
|
||||||
true /* sendUserLeaveHint */);
|
true /* sendUserLeaveHint */);
|
||||||
}
|
}
|
||||||
|
@ -1183,8 +1181,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
|
||||||
private void setupLauncherUiAfterSwipeUpToRecentsAnimation() {
|
private void setupLauncherUiAfterSwipeUpToRecentsAnimation() {
|
||||||
endLauncherTransitionController();
|
endLauncherTransitionController();
|
||||||
mActivityControlHelper.onSwipeUpToRecentsComplete(mActivity);
|
mActivityControlHelper.onSwipeUpToRecentsComplete(mActivity);
|
||||||
if (mRecentsAnimationWrapper != null) {
|
if (mRecentsAnimationController != null) {
|
||||||
mRecentsAnimationWrapper.setDeferCancelUntilNextTransition(true /* defer */,
|
mRecentsAnimationController.setDeferCancelUntilNextTransition(true /* defer */,
|
||||||
true /* screenshot */);
|
true /* screenshot */);
|
||||||
}
|
}
|
||||||
mRecentsView.onSwipeUpAnimationSuccess();
|
mRecentsView.onSwipeUpAnimationSuccess();
|
||||||
|
|
|
@ -29,6 +29,7 @@ import android.view.VelocityTracker;
|
||||||
import android.view.ViewConfiguration;
|
import android.view.ViewConfiguration;
|
||||||
|
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
|
import com.android.quickstep.InputConsumer;
|
||||||
import com.android.quickstep.RecentsAnimationDeviceState;
|
import com.android.quickstep.RecentsAnimationDeviceState;
|
||||||
import com.android.quickstep.util.MotionPauseDetector;
|
import com.android.quickstep.util.MotionPauseDetector;
|
||||||
import com.android.quickstep.SystemUiProxy;
|
import com.android.quickstep.SystemUiProxy;
|
||||||
|
|
|
@ -49,6 +49,7 @@ import com.android.launcher3.R;
|
||||||
import com.android.launcher3.anim.Interpolators;
|
import com.android.launcher3.anim.Interpolators;
|
||||||
import com.android.launcher3.logging.UserEventDispatcher;
|
import com.android.launcher3.logging.UserEventDispatcher;
|
||||||
import com.android.quickstep.ActivityControlHelper;
|
import com.android.quickstep.ActivityControlHelper;
|
||||||
|
import com.android.quickstep.InputConsumer;
|
||||||
import com.android.quickstep.SystemUiProxy;
|
import com.android.quickstep.SystemUiProxy;
|
||||||
import com.android.systemui.shared.system.InputMonitorCompat;
|
import com.android.systemui.shared.system.InputMonitorCompat;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.android.quickstep.inputconsumers;
|
||||||
|
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
|
import com.android.quickstep.InputConsumer;
|
||||||
import com.android.systemui.shared.system.InputMonitorCompat;
|
import com.android.systemui.shared.system.InputMonitorCompat;
|
||||||
|
|
||||||
public abstract class DelegateInputConsumer implements InputConsumer {
|
public abstract class DelegateInputConsumer implements InputConsumer {
|
||||||
|
|
|
@ -39,15 +39,15 @@ import android.view.ViewConfiguration;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.launcher3.Utilities;
|
import com.android.launcher3.Utilities;
|
||||||
import com.android.launcher3.util.DefaultDisplay;
|
import com.android.launcher3.util.DefaultDisplay;
|
||||||
|
import com.android.quickstep.InputConsumer;
|
||||||
import com.android.quickstep.LockScreenRecentsActivity;
|
import com.android.quickstep.LockScreenRecentsActivity;
|
||||||
import com.android.quickstep.MultiStateCallback;
|
import com.android.quickstep.MultiStateCallback;
|
||||||
|
import com.android.quickstep.RecentsAnimationController;
|
||||||
import com.android.quickstep.RecentsAnimationDeviceState;
|
import com.android.quickstep.RecentsAnimationDeviceState;
|
||||||
import com.android.quickstep.RecentsAnimationWrapper;
|
|
||||||
import com.android.quickstep.SwipeSharedState;
|
import com.android.quickstep.SwipeSharedState;
|
||||||
|
import com.android.quickstep.RecentsAnimationCallbacks;
|
||||||
|
import com.android.quickstep.RecentsAnimationTargets;
|
||||||
import com.android.quickstep.util.AppWindowAnimationHelper;
|
import com.android.quickstep.util.AppWindowAnimationHelper;
|
||||||
import com.android.quickstep.util.RecentsAnimationCallbacks;
|
|
||||||
import com.android.quickstep.util.RecentsAnimationTargets;
|
|
||||||
|
|
||||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||||
import com.android.systemui.shared.system.InputMonitorCompat;
|
import com.android.systemui.shared.system.InputMonitorCompat;
|
||||||
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
||||||
|
@ -92,7 +92,7 @@ public class DeviceLockedInputConsumer implements InputConsumer,
|
||||||
|
|
||||||
private boolean mThresholdCrossed = false;
|
private boolean mThresholdCrossed = false;
|
||||||
|
|
||||||
private RecentsAnimationWrapper mRecentsAnimationController;
|
private RecentsAnimationController mRecentsAnimationController;
|
||||||
private RecentsAnimationTargets mRecentsAnimationTargets;
|
private RecentsAnimationTargets mRecentsAnimationTargets;
|
||||||
|
|
||||||
public DeviceLockedInputConsumer(Context context, RecentsAnimationDeviceState deviceState,
|
public DeviceLockedInputConsumer(Context context, RecentsAnimationDeviceState deviceState,
|
||||||
|
@ -204,9 +204,8 @@ public class DeviceLockedInputConsumer implements InputConsumer,
|
||||||
|
|
||||||
private void startRecentsTransition() {
|
private void startRecentsTransition() {
|
||||||
mThresholdCrossed = true;
|
mThresholdCrossed = true;
|
||||||
RecentsAnimationCallbacks newListenerSet =
|
RecentsAnimationCallbacks callbacks = mSwipeSharedState.newRecentsAnimationCallbacks();
|
||||||
mSwipeSharedState.newRecentsAnimationListenerSet();
|
callbacks.addListener(this);
|
||||||
newListenerSet.addListener(this);
|
|
||||||
Intent intent = new Intent(Intent.ACTION_MAIN)
|
Intent intent = new Intent(Intent.ACTION_MAIN)
|
||||||
.addCategory(Intent.CATEGORY_DEFAULT)
|
.addCategory(Intent.CATEGORY_DEFAULT)
|
||||||
.setComponent(new ComponentName(mContext, LockScreenRecentsActivity.class))
|
.setComponent(new ComponentName(mContext, LockScreenRecentsActivity.class))
|
||||||
|
@ -214,17 +213,17 @@ public class DeviceLockedInputConsumer implements InputConsumer,
|
||||||
.putExtra(INTENT_EXTRA_LOG_TRACE_ID, mLogId);
|
.putExtra(INTENT_EXTRA_LOG_TRACE_ID, mLogId);
|
||||||
|
|
||||||
mInputMonitorCompat.pilferPointers();
|
mInputMonitorCompat.pilferPointers();
|
||||||
startRecentsActivityAsync(intent, newListenerSet);
|
startRecentsActivityAsync(intent, callbacks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecentsAnimationStart(RecentsAnimationWrapper controller,
|
public void onRecentsAnimationStart(RecentsAnimationController controller,
|
||||||
RecentsAnimationTargets targetSet) {
|
RecentsAnimationTargets targets) {
|
||||||
mRecentsAnimationController = controller;
|
mRecentsAnimationController = controller;
|
||||||
mRecentsAnimationTargets = targetSet;
|
mRecentsAnimationTargets = targets;
|
||||||
|
|
||||||
Rect displaySize = new Rect(0, 0, mDisplaySize.x, mDisplaySize.y);
|
Rect displaySize = new Rect(0, 0, mDisplaySize.x, mDisplaySize.y);
|
||||||
RemoteAnimationTargetCompat targetCompat = targetSet.findTask(mRunningTaskId);
|
RemoteAnimationTargetCompat targetCompat = targets.findTask(mRunningTaskId);
|
||||||
if (targetCompat != null) {
|
if (targetCompat != null) {
|
||||||
mAppWindowAnimationHelper.updateSource(displaySize, targetCompat);
|
mAppWindowAnimationHelper.updateSource(displaySize, targetCompat);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,15 +42,16 @@ import com.android.launcher3.util.ObjectWrapper;
|
||||||
import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory;
|
import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory;
|
||||||
import com.android.quickstep.AnimatedFloat;
|
import com.android.quickstep.AnimatedFloat;
|
||||||
import com.android.quickstep.BaseSwipeUpHandler;
|
import com.android.quickstep.BaseSwipeUpHandler;
|
||||||
|
import com.android.quickstep.InputConsumer;
|
||||||
import com.android.quickstep.MultiStateCallback;
|
import com.android.quickstep.MultiStateCallback;
|
||||||
import com.android.quickstep.OverviewComponentObserver;
|
import com.android.quickstep.OverviewComponentObserver;
|
||||||
import com.android.quickstep.RecentsActivity;
|
import com.android.quickstep.RecentsActivity;
|
||||||
import com.android.quickstep.RecentsAnimationWrapper;
|
import com.android.quickstep.RecentsAnimationController;
|
||||||
import com.android.quickstep.RecentsModel;
|
import com.android.quickstep.RecentsModel;
|
||||||
import com.android.quickstep.SwipeSharedState;
|
import com.android.quickstep.SwipeSharedState;
|
||||||
import com.android.quickstep.fallback.FallbackRecentsView;
|
import com.android.quickstep.fallback.FallbackRecentsView;
|
||||||
import com.android.quickstep.util.RectFSpringAnim;
|
import com.android.quickstep.util.RectFSpringAnim;
|
||||||
import com.android.quickstep.util.RecentsAnimationTargets;
|
import com.android.quickstep.RecentsAnimationTargets;
|
||||||
import com.android.quickstep.views.TaskView;
|
import com.android.quickstep.views.TaskView;
|
||||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||||
|
@ -232,8 +233,8 @@ public class FallbackNoButtonInputConsumer extends
|
||||||
@Override
|
@Override
|
||||||
public void updateFinalShift() {
|
public void updateFinalShift() {
|
||||||
mTransformParams.setProgress(mCurrentShift.value);
|
mTransformParams.setProgress(mCurrentShift.value);
|
||||||
if (mRecentsAnimationWrapper != null) {
|
if (mRecentsAnimationController != null) {
|
||||||
mRecentsAnimationWrapper.setWindowThresholdCrossed(!mInQuickSwitchMode
|
mRecentsAnimationController.setWindowThresholdCrossed(!mInQuickSwitchMode
|
||||||
&& (mCurrentShift.value > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD));
|
&& (mCurrentShift.value > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD));
|
||||||
}
|
}
|
||||||
if (mRecentsAnimationTargets != null) {
|
if (mRecentsAnimationTargets != null) {
|
||||||
|
@ -319,25 +320,25 @@ public class FallbackNoButtonInputConsumer extends
|
||||||
switch (mEndTarget) {
|
switch (mEndTarget) {
|
||||||
case HOME: {
|
case HOME: {
|
||||||
if (mSwipeUpOverHome) {
|
if (mSwipeUpOverHome) {
|
||||||
mRecentsAnimationWrapper.finish(false, null, false);
|
mRecentsAnimationController.finish(false, null, false);
|
||||||
// Send a home intent to clear the task stack
|
// Send a home intent to clear the task stack
|
||||||
mContext.startActivity(mOverviewComponentObserver.getHomeIntent());
|
mContext.startActivity(mOverviewComponentObserver.getHomeIntent());
|
||||||
} else {
|
} else {
|
||||||
mRecentsAnimationWrapper.finish(true, null, true);
|
mRecentsAnimationController.finish(true, null, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LAST_TASK:
|
case LAST_TASK:
|
||||||
mRecentsAnimationWrapper.finish(false, null, false);
|
mRecentsAnimationController.finish(false, null, false);
|
||||||
break;
|
break;
|
||||||
case RECENTS: {
|
case RECENTS: {
|
||||||
if (mSwipeUpOverHome) {
|
if (mSwipeUpOverHome) {
|
||||||
mRecentsAnimationWrapper.finish(true, null, true);
|
mRecentsAnimationController.finish(true, null, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ThumbnailData thumbnail = mRecentsAnimationWrapper.screenshotTask(mRunningTaskId);
|
ThumbnailData thumbnail = mRecentsAnimationController.screenshotTask(mRunningTaskId);
|
||||||
mRecentsAnimationWrapper.setDeferCancelUntilNextTransition(true /* defer */,
|
mRecentsAnimationController.setDeferCancelUntilNextTransition(true /* defer */,
|
||||||
false /* screenshot */);
|
false /* screenshot */);
|
||||||
|
|
||||||
ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0);
|
ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0);
|
||||||
|
@ -350,7 +351,7 @@ public class FallbackNoButtonInputConsumer extends
|
||||||
Intent intent = new Intent(mOverviewComponentObserver.getOverviewIntent())
|
Intent intent = new Intent(mOverviewComponentObserver.getOverviewIntent())
|
||||||
.putExtras(extras);
|
.putExtras(extras);
|
||||||
mContext.startActivity(intent, options.toBundle());
|
mContext.startActivity(intent, options.toBundle());
|
||||||
mRecentsAnimationWrapper.cleanupScreenshot();
|
mRecentsAnimationController.cleanupScreenshot();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NEW_TASK: {
|
case NEW_TASK: {
|
||||||
|
@ -416,10 +417,10 @@ public class FallbackNoButtonInputConsumer extends
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecentsAnimationStart(RecentsAnimationWrapper controller,
|
public void onRecentsAnimationStart(RecentsAnimationController controller,
|
||||||
RecentsAnimationTargets targetSet) {
|
RecentsAnimationTargets targets) {
|
||||||
super.onRecentsAnimationStart(controller, targetSet);
|
super.onRecentsAnimationStart(controller, targets);
|
||||||
mRecentsAnimationWrapper.enableInputConsumer();
|
mRecentsAnimationController.enableInputConsumer();
|
||||||
|
|
||||||
if (mRunningOverHome) {
|
if (mRunningOverHome) {
|
||||||
mAppWindowAnimationHelper.prepareAnimation(mDp, true);
|
mAppWindowAnimationHelper.prepareAnimation(mDp, true);
|
||||||
|
|
|
@ -53,6 +53,7 @@ import com.android.launcher3.util.TraceHelper;
|
||||||
import com.android.quickstep.ActivityControlHelper;
|
import com.android.quickstep.ActivityControlHelper;
|
||||||
import com.android.quickstep.BaseSwipeUpHandler;
|
import com.android.quickstep.BaseSwipeUpHandler;
|
||||||
import com.android.quickstep.BaseSwipeUpHandler.Factory;
|
import com.android.quickstep.BaseSwipeUpHandler.Factory;
|
||||||
|
import com.android.quickstep.InputConsumer;
|
||||||
import com.android.quickstep.RecentsAnimationDeviceState;
|
import com.android.quickstep.RecentsAnimationDeviceState;
|
||||||
import com.android.quickstep.SwipeSharedState;
|
import com.android.quickstep.SwipeSharedState;
|
||||||
import com.android.quickstep.SysUINavigationMode;
|
import com.android.quickstep.SysUINavigationMode;
|
||||||
|
@ -61,7 +62,7 @@ import com.android.quickstep.util.ActiveGestureLog;
|
||||||
import com.android.quickstep.util.CachedEventDispatcher;
|
import com.android.quickstep.util.CachedEventDispatcher;
|
||||||
import com.android.quickstep.util.MotionPauseDetector;
|
import com.android.quickstep.util.MotionPauseDetector;
|
||||||
import com.android.quickstep.util.NavBarPosition;
|
import com.android.quickstep.util.NavBarPosition;
|
||||||
import com.android.quickstep.util.RecentsAnimationCallbacks;
|
import com.android.quickstep.RecentsAnimationCallbacks;
|
||||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||||
import com.android.systemui.shared.system.InputMonitorCompat;
|
import com.android.systemui.shared.system.InputMonitorCompat;
|
||||||
|
|
||||||
|
@ -343,12 +344,11 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
|
||||||
mSwipeSharedState.applyActiveRecentsAnimationState(handler);
|
mSwipeSharedState.applyActiveRecentsAnimationState(handler);
|
||||||
notifyGestureStarted();
|
notifyGestureStarted();
|
||||||
} else {
|
} else {
|
||||||
RecentsAnimationCallbacks newListenerSet =
|
RecentsAnimationCallbacks callbacks = mSwipeSharedState.newRecentsAnimationCallbacks();
|
||||||
mSwipeSharedState.newRecentsAnimationListenerSet();
|
callbacks.addListener(handler);
|
||||||
newListenerSet.addListener(handler);
|
|
||||||
Intent intent = handler.getLaunchIntent();
|
Intent intent = handler.getLaunchIntent();
|
||||||
intent.putExtra(INTENT_EXTRA_LOG_TRACE_ID, mLogId);
|
intent.putExtra(INTENT_EXTRA_LOG_TRACE_ID, mLogId);
|
||||||
startRecentsActivityAsync(intent, newListenerSet);
|
startRecentsActivityAsync(intent, callbacks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ import com.android.launcher3.BaseDraggingActivity;
|
||||||
import com.android.launcher3.Utilities;
|
import com.android.launcher3.Utilities;
|
||||||
import com.android.launcher3.views.BaseDragLayer;
|
import com.android.launcher3.views.BaseDragLayer;
|
||||||
import com.android.quickstep.ActivityControlHelper;
|
import com.android.quickstep.ActivityControlHelper;
|
||||||
|
import com.android.quickstep.InputConsumer;
|
||||||
import com.android.quickstep.util.ActiveGestureLog;
|
import com.android.quickstep.util.ActiveGestureLog;
|
||||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||||
import com.android.systemui.shared.system.InputMonitorCompat;
|
import com.android.systemui.shared.system.InputMonitorCompat;
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.android.launcher3.logging.StatsLogUtils;
|
||||||
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
|
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
|
||||||
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
|
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
|
||||||
import com.android.quickstep.ActivityControlHelper;
|
import com.android.quickstep.ActivityControlHelper;
|
||||||
|
import com.android.quickstep.InputConsumer;
|
||||||
import com.android.quickstep.util.ActiveGestureLog;
|
import com.android.quickstep.util.ActiveGestureLog;
|
||||||
import com.android.quickstep.util.NavBarPosition;
|
import com.android.quickstep.util.NavBarPosition;
|
||||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||||
|
|
|
@ -36,6 +36,7 @@ import android.view.ViewConfiguration;
|
||||||
import com.android.launcher3.BaseDraggingActivity;
|
import com.android.launcher3.BaseDraggingActivity;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.quickstep.ActivityControlHelper;
|
import com.android.quickstep.ActivityControlHelper;
|
||||||
|
import com.android.quickstep.InputConsumer;
|
||||||
import com.android.quickstep.views.RecentsView;
|
import com.android.quickstep.views.RecentsView;
|
||||||
import com.android.systemui.shared.system.InputMonitorCompat;
|
import com.android.systemui.shared.system.InputMonitorCompat;
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ package com.android.quickstep.inputconsumers;
|
||||||
|
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
|
import com.android.quickstep.InputConsumer;
|
||||||
import com.android.quickstep.SwipeSharedState;
|
import com.android.quickstep.SwipeSharedState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -22,6 +22,7 @@ import android.view.MotionEvent;
|
||||||
import com.android.launcher3.BaseDraggingActivity;
|
import com.android.launcher3.BaseDraggingActivity;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.quickstep.ActivityControlHelper;
|
import com.android.quickstep.ActivityControlHelper;
|
||||||
|
import com.android.quickstep.InputConsumer;
|
||||||
import com.android.quickstep.util.MotionPauseDetector;
|
import com.android.quickstep.util.MotionPauseDetector;
|
||||||
import com.android.quickstep.SystemUiProxy;
|
import com.android.quickstep.SystemUiProxy;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ import com.android.launcher3.BaseDraggingActivity;
|
||||||
import com.android.launcher3.DeviceProfile;
|
import com.android.launcher3.DeviceProfile;
|
||||||
import com.android.launcher3.LauncherState;
|
import com.android.launcher3.LauncherState;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
|
import com.android.quickstep.RemoteAnimationTargets;
|
||||||
import com.android.quickstep.SystemUiProxy;
|
import com.android.quickstep.SystemUiProxy;
|
||||||
import com.android.launcher3.Utilities;
|
import com.android.launcher3.Utilities;
|
||||||
import com.android.launcher3.views.BaseDragLayer;
|
import com.android.launcher3.views.BaseDragLayer;
|
||||||
|
|
|
@ -220,7 +220,7 @@ public class LauncherRecentsView extends RecentsView<Launcher> implements StateL
|
||||||
@Override
|
@Override
|
||||||
public AppWindowAnimationHelper.TransformParams getLiveTileParams(
|
public AppWindowAnimationHelper.TransformParams getLiveTileParams(
|
||||||
boolean mightNeedToRefill) {
|
boolean mightNeedToRefill) {
|
||||||
if (!mEnableDrawingLiveTile || mRecentsAnimationWrapper == null
|
if (!mEnableDrawingLiveTile || mRecentsAnimationController == null
|
||||||
|| mRecentsAnimationTargets == null || mAppWindowAnimationHelper == null) {
|
|| mRecentsAnimationTargets == null || mAppWindowAnimationHelper == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,14 +101,14 @@ import com.android.launcher3.util.OverScroller;
|
||||||
import com.android.launcher3.util.PendingAnimation;
|
import com.android.launcher3.util.PendingAnimation;
|
||||||
import com.android.launcher3.util.Themes;
|
import com.android.launcher3.util.Themes;
|
||||||
import com.android.launcher3.util.ViewPool;
|
import com.android.launcher3.util.ViewPool;
|
||||||
import com.android.quickstep.RecentsAnimationWrapper;
|
import com.android.quickstep.RecentsAnimationController;
|
||||||
import com.android.quickstep.RecentsModel;
|
import com.android.quickstep.RecentsModel;
|
||||||
import com.android.quickstep.RecentsModel.TaskThumbnailChangeListener;
|
import com.android.quickstep.RecentsModel.TaskThumbnailChangeListener;
|
||||||
import com.android.quickstep.TaskThumbnailCache;
|
import com.android.quickstep.TaskThumbnailCache;
|
||||||
import com.android.quickstep.TaskUtils;
|
import com.android.quickstep.TaskUtils;
|
||||||
import com.android.quickstep.ViewUtils;
|
import com.android.quickstep.ViewUtils;
|
||||||
import com.android.quickstep.util.AppWindowAnimationHelper;
|
import com.android.quickstep.util.AppWindowAnimationHelper;
|
||||||
import com.android.quickstep.util.RecentsAnimationTargets;
|
import com.android.quickstep.RecentsAnimationTargets;
|
||||||
import com.android.systemui.shared.recents.model.Task;
|
import com.android.systemui.shared.recents.model.Task;
|
||||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||||
|
@ -156,7 +156,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
protected RecentsAnimationWrapper mRecentsAnimationWrapper;
|
protected RecentsAnimationController mRecentsAnimationController;
|
||||||
protected RecentsAnimationTargets mRecentsAnimationTargets;
|
protected RecentsAnimationTargets mRecentsAnimationTargets;
|
||||||
protected AppWindowAnimationHelper mAppWindowAnimationHelper;
|
protected AppWindowAnimationHelper mAppWindowAnimationHelper;
|
||||||
protected SyncRtSurfaceTransactionApplierCompat mSyncTransactionApplier;
|
protected SyncRtSurfaceTransactionApplierCompat mSyncTransactionApplier;
|
||||||
|
@ -809,7 +809,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||||
mIgnoreResetTaskId = -1;
|
mIgnoreResetTaskId = -1;
|
||||||
mTaskListChangeId = -1;
|
mTaskListChangeId = -1;
|
||||||
|
|
||||||
mRecentsAnimationWrapper = null;
|
mRecentsAnimationController = null;
|
||||||
mRecentsAnimationTargets = null;
|
mRecentsAnimationTargets = null;
|
||||||
mAppWindowAnimationHelper = null;
|
mAppWindowAnimationHelper = null;
|
||||||
|
|
||||||
|
@ -1696,9 +1696,9 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||||
public void redrawLiveTile(boolean mightNeedToRefill) { }
|
public void redrawLiveTile(boolean mightNeedToRefill) { }
|
||||||
|
|
||||||
// TODO: To be removed in a follow up CL
|
// TODO: To be removed in a follow up CL
|
||||||
public void setRecentsAnimationTargets(RecentsAnimationWrapper recentsAnimationWrapper,
|
public void setRecentsAnimationTargets(RecentsAnimationController recentsAnimationController,
|
||||||
RecentsAnimationTargets recentsAnimationTargets) {
|
RecentsAnimationTargets recentsAnimationTargets) {
|
||||||
mRecentsAnimationWrapper = recentsAnimationWrapper;
|
mRecentsAnimationController = recentsAnimationController;
|
||||||
mRecentsAnimationTargets = recentsAnimationTargets;
|
mRecentsAnimationTargets = recentsAnimationTargets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1718,14 +1718,14 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finishRecentsAnimation(boolean toRecents, Runnable onFinishComplete) {
|
public void finishRecentsAnimation(boolean toRecents, Runnable onFinishComplete) {
|
||||||
if (mRecentsAnimationWrapper == null) {
|
if (mRecentsAnimationController == null) {
|
||||||
if (onFinishComplete != null) {
|
if (onFinishComplete != null) {
|
||||||
onFinishComplete.run();
|
onFinishComplete.run();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mRecentsAnimationWrapper.finish(toRecents, onFinishComplete);
|
mRecentsAnimationController.finish(toRecents, onFinishComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDisallowScrollToClearAll(boolean disallowScrollToClearAll) {
|
public void setDisallowScrollToClearAll(boolean disallowScrollToClearAll) {
|
||||||
|
|
|
@ -71,7 +71,7 @@ import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
|
||||||
import com.android.launcher3.views.FloatingIconView;
|
import com.android.launcher3.views.FloatingIconView;
|
||||||
import com.android.quickstep.util.MultiValueUpdateListener;
|
import com.android.quickstep.util.MultiValueUpdateListener;
|
||||||
import com.android.quickstep.util.RemoteAnimationProvider;
|
import com.android.quickstep.util.RemoteAnimationProvider;
|
||||||
import com.android.quickstep.util.RemoteAnimationTargets;
|
import com.android.quickstep.RemoteAnimationTargets;
|
||||||
import com.android.systemui.shared.system.ActivityCompat;
|
import com.android.systemui.shared.system.ActivityCompat;
|
||||||
import com.android.systemui.shared.system.ActivityOptionsCompat;
|
import com.android.systemui.shared.system.ActivityOptionsCompat;
|
||||||
import com.android.systemui.shared.system.QuickStepContract;
|
import com.android.systemui.shared.system.QuickStepContract;
|
||||||
|
|
|
@ -32,7 +32,6 @@ import com.android.launcher3.BaseDraggingActivity;
|
||||||
import com.android.launcher3.DeviceProfile;
|
import com.android.launcher3.DeviceProfile;
|
||||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||||
import com.android.quickstep.util.ActivityInitListener;
|
import com.android.quickstep.util.ActivityInitListener;
|
||||||
import com.android.quickstep.util.RemoteAnimationTargets;
|
|
||||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||||
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.android.quickstep.inputconsumers;
|
package com.android.quickstep;
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.android.quickstep.util;
|
package com.android.quickstep;
|
||||||
|
|
||||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||||
|
|
||||||
|
@ -25,8 +25,6 @@ import androidx.annotation.UiThread;
|
||||||
|
|
||||||
import com.android.launcher3.Utilities;
|
import com.android.launcher3.Utilities;
|
||||||
import com.android.launcher3.util.Preconditions;
|
import com.android.launcher3.util.Preconditions;
|
||||||
import com.android.quickstep.TouchInteractionService;
|
|
||||||
import com.android.quickstep.RecentsAnimationWrapper;
|
|
||||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||||
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
|
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
|
||||||
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
||||||
|
@ -44,7 +42,7 @@ public class RecentsAnimationCallbacks implements
|
||||||
private final boolean mShouldMinimizeSplitScreen;
|
private final boolean mShouldMinimizeSplitScreen;
|
||||||
|
|
||||||
// TODO(141886704): Remove these references when they are no longer needed
|
// TODO(141886704): Remove these references when they are no longer needed
|
||||||
private RecentsAnimationWrapper mController;
|
private RecentsAnimationController mController;
|
||||||
|
|
||||||
private boolean mCancelled;
|
private boolean mCancelled;
|
||||||
|
|
||||||
|
@ -85,10 +83,10 @@ public class RecentsAnimationCallbacks implements
|
||||||
RemoteAnimationTargetCompat[] appTargets,
|
RemoteAnimationTargetCompat[] appTargets,
|
||||||
RemoteAnimationTargetCompat[] wallpaperTargets,
|
RemoteAnimationTargetCompat[] wallpaperTargets,
|
||||||
Rect homeContentInsets, Rect minimizedHomeBounds) {
|
Rect homeContentInsets, Rect minimizedHomeBounds) {
|
||||||
RecentsAnimationTargets targetSet = new RecentsAnimationTargets(appTargets,
|
RecentsAnimationTargets targets = new RecentsAnimationTargets(appTargets,
|
||||||
wallpaperTargets, homeContentInsets, minimizedHomeBounds);
|
wallpaperTargets, homeContentInsets, minimizedHomeBounds);
|
||||||
mController = new RecentsAnimationWrapper(animationController, mShouldMinimizeSplitScreen,
|
mController = new RecentsAnimationController(animationController,
|
||||||
this::onAnimationFinished);
|
mShouldMinimizeSplitScreen, this::onAnimationFinished);
|
||||||
|
|
||||||
if (mCancelled) {
|
if (mCancelled) {
|
||||||
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(),
|
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(),
|
||||||
|
@ -96,7 +94,7 @@ public class RecentsAnimationCallbacks implements
|
||||||
} else {
|
} else {
|
||||||
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
|
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
|
||||||
for (RecentsAnimationListener listener : getListeners()) {
|
for (RecentsAnimationListener listener : getListeners()) {
|
||||||
listener.onRecentsAnimationStart(mController, targetSet);
|
listener.onRecentsAnimationStart(mController, targets);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -112,7 +110,7 @@ public class RecentsAnimationCallbacks implements
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void onAnimationFinished(RecentsAnimationWrapper controller) {
|
private final void onAnimationFinished(RecentsAnimationController controller) {
|
||||||
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
|
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
|
||||||
for (RecentsAnimationListener listener : getListeners()) {
|
for (RecentsAnimationListener listener : getListeners()) {
|
||||||
listener.onRecentsAnimationFinished(controller);
|
listener.onRecentsAnimationFinished(controller);
|
||||||
|
@ -128,7 +126,7 @@ public class RecentsAnimationCallbacks implements
|
||||||
* Listener for the recents animation callbacks.
|
* Listener for the recents animation callbacks.
|
||||||
*/
|
*/
|
||||||
public interface RecentsAnimationListener {
|
public interface RecentsAnimationListener {
|
||||||
default void onRecentsAnimationStart(RecentsAnimationWrapper controller,
|
default void onRecentsAnimationStart(RecentsAnimationController controller,
|
||||||
RecentsAnimationTargets targetSet) {}
|
RecentsAnimationTargets targetSet) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -137,6 +135,6 @@ public class RecentsAnimationCallbacks implements
|
||||||
*/
|
*/
|
||||||
default void onRecentsAnimationCanceled(ThumbnailData thumbnailData) {}
|
default void onRecentsAnimationCanceled(ThumbnailData thumbnailData) {}
|
||||||
|
|
||||||
default void onRecentsAnimationFinished(RecentsAnimationWrapper controller) {}
|
default void onRecentsAnimationFinished(RecentsAnimationController controller) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -30,12 +30,8 @@ import android.view.MotionEvent;
|
||||||
import androidx.annotation.UiThread;
|
import androidx.annotation.UiThread;
|
||||||
|
|
||||||
import com.android.launcher3.util.Preconditions;
|
import com.android.launcher3.util.Preconditions;
|
||||||
import com.android.quickstep.inputconsumers.InputConsumer;
|
|
||||||
import com.android.quickstep.util.RecentsAnimationCallbacks;
|
|
||||||
import com.android.quickstep.util.RecentsAnimationTargets;
|
|
||||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||||
import com.android.systemui.shared.system.InputConsumerController;
|
import com.android.systemui.shared.system.InputConsumerController;
|
||||||
|
|
||||||
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
|
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
@ -44,12 +40,12 @@ import java.util.function.Supplier;
|
||||||
/**
|
/**
|
||||||
* Wrapper around RecentsAnimationController to help with some synchronization
|
* Wrapper around RecentsAnimationController to help with some synchronization
|
||||||
*/
|
*/
|
||||||
public class RecentsAnimationWrapper {
|
public class RecentsAnimationController {
|
||||||
|
|
||||||
private static final String TAG = "RecentsAnimationWrapper";
|
private static final String TAG = "RecentsAnimationController";
|
||||||
|
|
||||||
private final RecentsAnimationControllerCompat mController;
|
private final RecentsAnimationControllerCompat mController;
|
||||||
private final Consumer<RecentsAnimationWrapper> mOnFinishedListener;
|
private final Consumer<RecentsAnimationController> mOnFinishedListener;
|
||||||
private final boolean mShouldMinimizeSplitScreen;
|
private final boolean mShouldMinimizeSplitScreen;
|
||||||
|
|
||||||
private boolean mWindowThresholdCrossed = false;
|
private boolean mWindowThresholdCrossed = false;
|
||||||
|
@ -60,9 +56,9 @@ public class RecentsAnimationWrapper {
|
||||||
private boolean mTouchInProgress;
|
private boolean mTouchInProgress;
|
||||||
private boolean mFinishPending;
|
private boolean mFinishPending;
|
||||||
|
|
||||||
public RecentsAnimationWrapper(RecentsAnimationControllerCompat controller,
|
public RecentsAnimationController(RecentsAnimationControllerCompat controller,
|
||||||
boolean shouldMinimizeSplitScreen,
|
boolean shouldMinimizeSplitScreen,
|
||||||
Consumer<RecentsAnimationWrapper> onFinishedListener) {
|
Consumer<RecentsAnimationController> onFinishedListener) {
|
||||||
mController = controller;
|
mController = controller;
|
||||||
mOnFinishedListener = onFinishedListener;
|
mOnFinishedListener = onFinishedListener;
|
||||||
mShouldMinimizeSplitScreen = shouldMinimizeSplitScreen;
|
mShouldMinimizeSplitScreen = shouldMinimizeSplitScreen;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.android.quickstep.util;
|
package com.android.quickstep;
|
||||||
|
|
||||||
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
|
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.android.quickstep.util;
|
package com.android.quickstep;
|
||||||
|
|
||||||
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
||||||
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat;
|
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat;
|
|
@ -21,6 +21,7 @@ import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MOD
|
||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
import android.animation.ValueAnimator.AnimatorUpdateListener;
|
import android.animation.ValueAnimator.AnimatorUpdateListener;
|
||||||
|
|
||||||
|
import com.android.quickstep.RemoteAnimationTargets;
|
||||||
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
||||||
import com.android.systemui.shared.system.TransactionCompat;
|
import com.android.systemui.shared.system.TransactionCompat;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue