1/ Renaming some classes for clarity

- SwipeAnimationTargetSet -> RecentsAnimationTargets
- RemoteAnimationTargetSet -> RemoteAnimationTargets
- RecentsAnimationListenerSet -> RecentsAnimationCallbacks
- SwipeAnimationTargetSet.SwipeAnimationListener -> RecentsAnimationCallbacks.RecentsAnimationListener
- ClipAnimationHelper -> AppWindowAnimationHelper
- AssistantTouchConsumer -> AssistantInputConsumer

Bug: 141886704

Change-Id: I78485a1651bb360ffbac2d0c462855931a995ee1
This commit is contained in:
Winson Chung
2019-09-30 15:56:39 -07:00
parent 023188e424
commit 92a015f2fc
27 changed files with 190 additions and 185 deletions
@@ -32,7 +32,7 @@ import android.util.Log;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.LauncherAnimationRunner;
import com.android.quickstep.util.RemoteAnimationProvider;
import com.android.quickstep.util.RemoteAnimationTargetSet;
import com.android.quickstep.util.RemoteAnimationTargets;
import com.android.quickstep.views.IconRecentsView;
import com.android.systemui.shared.system.ActivityOptionsCompat;
import com.android.systemui.shared.system.RemoteAnimationAdapterCompat;
@@ -113,8 +113,8 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
return anim;
}
RemoteAnimationTargetSet targetSet =
new RemoteAnimationTargetSet(appTargets, wallpaperTargets, MODE_CLOSING);
RemoteAnimationTargets targetSet =
new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_CLOSING);
mRecentsView.setTransitionedFromApp(!targetSet.isAnimatingHome());
RemoteAnimationTargetCompat recentsTarget = null;
@@ -27,7 +27,7 @@ import androidx.annotation.Nullable;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.quickstep.util.ActivityInitListener;
import com.android.quickstep.util.RemoteAnimationTargetSet;
import com.android.quickstep.util.RemoteAnimationTargets;
import com.android.quickstep.views.IconRecentsView;
import java.util.function.BiPredicate;
@@ -59,7 +59,7 @@ public final class FallbackActivityControllerHelper extends
boolean isAnimatingToRecents = false;
@Override
public void onRemoteAnimationReceived(RemoteAnimationTargetSet targets) {
public void onRemoteAnimationReceived(RemoteAnimationTargets targets) {
isAnimatingToRecents = targets != null && targets.isAnimatingHome();
if (!isAnimatingToRecents) {
rv.setAlpha(1);
@@ -36,7 +36,7 @@ import androidx.annotation.Nullable;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.anim.SpringAnimationBuilder;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.AppWindowAnimationHelper;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -71,7 +71,7 @@ public final class LauncherAppTransitionManagerImpl extends QuickstepAppTransiti
TaskView taskView = findTaskViewToLaunch(mLauncher, v, appTargets);
ClipAnimationHelper helper = new ClipAnimationHelper(mLauncher);
AppWindowAnimationHelper helper = new AppWindowAnimationHelper(mLauncher);
anim.play(getRecentsWindowAnimator(taskView, skipLauncherChanges, appTargets,
wallpaperTargets, helper).setDuration(RECENTS_LAUNCH_DURATION));
@@ -78,7 +78,7 @@ public class BackgroundAppState extends OverviewState {
} else {
dummyTask = recentsView.getTaskViewAt(0);
}
return recentsView.getTempClipAnimationHelper().updateForFullscreenOverview(dummyTask)
return recentsView.getTempAppWindowAnimationHelper().updateForFullscreenOverview(dummyTask)
.getScaleAndTranslation();
}
@@ -30,9 +30,9 @@ import android.view.View;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.AppWindowAnimationHelper;
import com.android.quickstep.util.RemoteAnimationProvider;
import com.android.quickstep.util.RemoteAnimationTargetSet;
import com.android.quickstep.util.RemoteAnimationTargets;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat;
@@ -115,7 +115,7 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
return anim;
}
RemoteAnimationTargetSet targetSet = new RemoteAnimationTargetSet(appTargets,
RemoteAnimationTargets targetSet = new RemoteAnimationTargets(appTargets,
wallpaperTargets, MODE_CLOSING);
// Use the top closing app to determine the insets for the animation
@@ -126,7 +126,7 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
return anim;
}
final ClipAnimationHelper clipHelper = new ClipAnimationHelper(mActivity);
final AppWindowAnimationHelper clipHelper = new AppWindowAnimationHelper(mActivity);
// At this point, the activity is already started and laid-out. Get the home-bounds
// relative to the screen using the rootView of the activity.
@@ -142,7 +142,7 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
clipHelper.updateTargetRect(targetRect);
clipHelper.prepareAnimation(mActivity.getDeviceProfile(), false /* isOpening */);
ClipAnimationHelper.TransformParams params = new ClipAnimationHelper.TransformParams()
AppWindowAnimationHelper.TransformParams params = new AppWindowAnimationHelper.TransformParams()
.setSyncTransactionApplier(new SyncRtSurfaceTransactionApplierCompat(rootView));
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1);
valueAnimator.setDuration(RECENTS_LAUNCH_DURATION);
@@ -156,7 +156,7 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
if (targetSet.isAnimatingHome()) {
// If we are animating home, fade in the opening targets
RemoteAnimationTargetSet openingSet = new RemoteAnimationTargetSet(appTargets,
RemoteAnimationTargets openingSet = new RemoteAnimationTargets(appTargets,
wallpaperTargets, MODE_OPENING);
TransactionCompat transaction = new TransactionCompat();
@@ -61,12 +61,12 @@ import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory;
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.inputconsumers.InputConsumer;
import com.android.quickstep.util.ActivityInitListener;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.ClipAnimationHelper.TransformParams;
import com.android.quickstep.util.AppWindowAnimationHelper;
import com.android.quickstep.util.AppWindowAnimationHelper.TransformParams;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.quickstep.util.RemoteAnimationTargetSet;
import com.android.quickstep.util.SwipeAnimationTargetSet;
import com.android.quickstep.util.SwipeAnimationTargetSet.SwipeAnimationListener;
import com.android.quickstep.util.RemoteAnimationTargets;
import com.android.quickstep.util.RecentsAnimationTargets;
import com.android.quickstep.util.RecentsAnimationCallbacks.RecentsAnimationListener;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.system.InputConsumerController;
@@ -80,7 +80,7 @@ import java.util.function.Consumer;
*/
@TargetApi(Build.VERSION_CODES.Q)
public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q extends RecentsView>
implements SwipeAnimationListener {
implements RecentsAnimationListener {
private static final String TAG = "BaseSwipeUpHandler";
protected static final Rect TEMP_RECT = new Rect();
@@ -102,7 +102,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
protected final RecentsModel mRecentsModel;
protected final int mRunningTaskId;
protected final ClipAnimationHelper mClipAnimationHelper;
protected final AppWindowAnimationHelper mAppWindowAnimationHelper;
protected final TransformParams mTransformParams = new TransformParams();
private final Vibrator mVibrator;
@@ -144,7 +144,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
this::createNewInputProxyHandler);
mMode = SysUINavigationMode.getMode(context);
mClipAnimationHelper = new ClipAnimationHelper(context);
mAppWindowAnimationHelper = new AppWindowAnimationHelper(context);
mPageSpacing = context.getResources().getDimensionPixelSize(R.dimen.recents_page_spacing);
mVibrator = context.getSystemService(Vibrator.class);
initTransitionEndpoints(InvariantDeviceProfile.INSTANCE.get(mContext)
@@ -220,7 +220,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
}
});
mRecentsView.setRecentsAnimationWrapper(mRecentsAnimationWrapper);
mRecentsView.setClipAnimationHelper(mClipAnimationHelper);
mRecentsView.setAppWindowAnimationHelper(mAppWindowAnimationHelper);
}
protected void startNewTask(int successStateFlag, Consumer<Boolean> resultCallback) {
@@ -257,7 +257,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
}
@Override
public void onRecentsAnimationStart(SwipeAnimationTargetSet targetSet) {
public void onRecentsAnimationStart(RecentsAnimationTargets targetSet) {
DeviceProfile dp = InvariantDeviceProfile.INSTANCE.get(mContext).getDeviceProfile(mContext);
final Rect overviewStackBounds;
RemoteAnimationTargetCompat runningTaskTarget = targetSet.findTask(mRunningTaskId);
@@ -275,10 +275,10 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
dp.updateInsets(targetSet.homeContentInsets);
dp.updateIsSeascape(mContext);
if (runningTaskTarget != null) {
mClipAnimationHelper.updateSource(overviewStackBounds, runningTaskTarget);
mAppWindowAnimationHelper.updateSource(overviewStackBounds, runningTaskTarget);
}
mClipAnimationHelper.prepareAnimation(dp, false /* isOpening */);
mAppWindowAnimationHelper.prepareAnimation(dp, false /* isOpening */);
initTransitionEndpoints(dp);
mRecentsAnimationWrapper.setController(targetSet);
@@ -306,9 +306,9 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
// screen of the launcher window may be stale (position is not updated until first
// traversal after the window is resized). We only do this for non-multiwindow because
// we otherwise use the minimized home bounds provided by the system.
mClipAnimationHelper.updateHomeBounds(getStackBounds(dp));
mAppWindowAnimationHelper.updateHomeBounds(getStackBounds(dp));
}
mClipAnimationHelper.updateTargetRect(TEMP_RECT);
mAppWindowAnimationHelper.updateTargetRect(TEMP_RECT);
if (mMode == Mode.NO_BUTTON) {
// We can drag all the way to the top of the screen.
mDragLengthFactor = (float) dp.heightPx / mTransitionDragLength;
@@ -366,13 +366,13 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
float shift = mCurrentShift.value;
float offsetX = mRecentsView == null ? 0 : mRecentsView.getScrollOffset();
float offsetScale = getTaskCurveScaleForOffsetX(offsetX,
mClipAnimationHelper.getTargetRect().width());
mAppWindowAnimationHelper.getTargetRect().width());
mTransformParams.setProgress(shift)
.setOffsetX(offsetX)
.setOffsetScale(offsetScale)
.setTargetSet(mRecentsAnimationWrapper.targetSet)
.setLauncherOnTop(true);
mClipAnimationHelper.applyTransform(mTransformParams);
mAppWindowAnimationHelper.applyTransform(mTransformParams);
}
private float getTaskCurveScaleForOffsetX(float offsetX, float taskWidth) {
@@ -388,9 +388,9 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
*/
protected RectFSpringAnim createWindowAnimationToHome(float startProgress,
HomeAnimationFactory homeAnimationFactory) {
final RemoteAnimationTargetSet targetSet = mRecentsAnimationWrapper.targetSet;
final RemoteAnimationTargets targetSet = mRecentsAnimationWrapper.targetSet;
final RectF startRect = new RectF(
mClipAnimationHelper.applyTransform(
mAppWindowAnimationHelper.applyTransform(
mTransformParams.setProgress(startProgress)
.setTargetSet(targetSet)
.setLauncherOnTop(false)));
@@ -409,7 +409,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
// End on a "round-enough" radius so that the shape reveal doesn't have to do too much
// rounding at the end of the animation.
float startRadius = mClipAnimationHelper.getCurrentCornerRadius();
float startRadius = mAppWindowAnimationHelper.getCurrentCornerRadius();
float endRadius = startRect.width() / 6f;
// We want the window alpha to be 0 once this threshold is met, so that the
// FolderIconView can be seen morphing into the icon shape.
@@ -440,11 +440,11 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
mTransformParams.setCornerRadius(endRadius * progress + startRadius
* (1f - progress));
}
mClipAnimationHelper.applyTransform(mTransformParams);
mAppWindowAnimationHelper.applyTransform(mTransformParams);
if (isFloatingIconView) {
((FloatingIconView) floatingView).update(currentRect, 1f, progress,
windowAlphaThreshold, mClipAnimationHelper.getCurrentCornerRadius(),
windowAlphaThreshold, mAppWindowAnimationHelper.getCurrentCornerRadius(),
false);
}
}
@@ -37,7 +37,7 @@ import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.quickstep.fallback.FallbackRecentsView;
import com.android.quickstep.util.ActivityInitListener;
import com.android.quickstep.util.LayoutUtils;
import com.android.quickstep.util.RemoteAnimationTargetSet;
import com.android.quickstep.util.RemoteAnimationTargets;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -138,7 +138,7 @@ public final class FallbackActivityControllerHelper implements
boolean isAnimatingToRecents = false;
@Override
public void onRemoteAnimationReceived(RemoteAnimationTargetSet targets) {
public void onRemoteAnimationReceived(RemoteAnimationTargets targets) {
isAnimatingToRecents = targets != null && targets.isAnimatingHome();
if (!isAnimatingToRecents) {
rv.setContentAlpha(1);
@@ -42,7 +42,7 @@ import com.android.launcher3.util.ObjectWrapper;
import com.android.launcher3.views.BaseDragLayer;
import com.android.quickstep.fallback.FallbackRecentsView;
import com.android.quickstep.fallback.RecentsRootView;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.AppWindowAnimationHelper;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityOptionsCompat;
@@ -177,7 +177,7 @@ public final class RecentsActivity extends BaseRecentsActivity {
RemoteAnimationTargetCompat[] wallpaperTargets) {
AnimatorSet target = new AnimatorSet();
boolean activityClosing = taskIsATargetWithMode(appTargets, getTaskId(), MODE_CLOSING);
ClipAnimationHelper helper = new ClipAnimationHelper(this);
AppWindowAnimationHelper helper = new AppWindowAnimationHelper(this);
target.play(getRecentsWindowAnimator(taskView, !activityClosing, appTargets,
wallpaperTargets, helper).setDuration(RECENTS_LAUNCH_DURATION));
@@ -29,7 +29,7 @@ import androidx.annotation.UiThread;
import com.android.launcher3.util.Preconditions;
import com.android.quickstep.inputconsumers.InputConsumer;
import com.android.quickstep.util.SwipeAnimationTargetSet;
import com.android.quickstep.util.RecentsAnimationTargets;
import com.android.systemui.shared.system.InputConsumerController;
import java.util.ArrayList;
@@ -46,7 +46,7 @@ public class RecentsAnimationWrapper {
// than the state callbacks as these run on the current worker thread.
private final ArrayList<Runnable> mCallbacks = new ArrayList<>();
public SwipeAnimationTargetSet targetSet;
public RecentsAnimationTargets targetSet;
private boolean mWindowThresholdCrossed = false;
@@ -69,7 +69,7 @@ public class RecentsAnimationWrapper {
}
@UiThread
public synchronized void setController(SwipeAnimationTargetSet targetSet) {
public synchronized void setController(RecentsAnimationTargets targetSet) {
Preconditions.assertUIThread();
this.targetSet = targetSet;
@@ -127,7 +127,7 @@ public class RecentsAnimationWrapper {
private void finishAndClear(boolean toRecents, Runnable onFinishComplete,
boolean sendUserLeaveHint) {
SwipeAnimationTargetSet controller = targetSet;
RecentsAnimationTargets controller = targetSet;
targetSet = null;
disableInputProxy();
if (controller != null) {
@@ -221,7 +221,7 @@ public class RecentsAnimationWrapper {
}
}
public SwipeAnimationTargetSet getController() {
public RecentsAnimationTargets getController() {
return targetSet;
}
}
@@ -22,9 +22,10 @@ import android.util.Log;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.util.Preconditions;
import com.android.quickstep.util.RecentsAnimationListenerSet;
import com.android.quickstep.util.SwipeAnimationTargetSet;
import com.android.quickstep.util.SwipeAnimationTargetSet.SwipeAnimationListener;
import com.android.quickstep.util.RecentsAnimationCallbacks;
import com.android.quickstep.util.RecentsAnimationTargets;
import com.android.quickstep.util.RecentsAnimationCallbacks.RecentsAnimationListener;
import com.android.systemui.shared.recents.model.ThumbnailData;
import java.io.PrintWriter;
@@ -32,12 +33,14 @@ import java.io.PrintWriter;
/**
* Utility class used to store state information shared across multiple transitions.
*/
public class SwipeSharedState implements SwipeAnimationListener {
public class SwipeSharedState implements RecentsAnimationListener {
private OverviewComponentObserver mOverviewComponentObserver;
private RecentsAnimationListenerSet mRecentsAnimationListener;
private SwipeAnimationTargetSet mLastAnimationTarget;
private RecentsAnimationCallbacks mRecentsAnimationListener;
private RecentsAnimationTargets mLastAnimationTarget;
// TODO: Remove
private Runnable mRecentsAnimationCanceledCallback;
private boolean mLastAnimationCancelled = false;
@@ -54,7 +57,7 @@ public class SwipeSharedState implements SwipeAnimationListener {
}
@Override
public final void onRecentsAnimationStart(SwipeAnimationTargetSet targetSet) {
public final void onRecentsAnimationStart(RecentsAnimationTargets targetSet) {
mLastAnimationTarget = targetSet;
mLastAnimationCancelled = false;
@@ -113,13 +116,13 @@ public class SwipeSharedState implements SwipeAnimationListener {
mLastAnimationRunning = false;
}
private void onSwipeAnimationFinished(SwipeAnimationTargetSet targetSet) {
private void onSwipeAnimationFinished(RecentsAnimationTargets targetSet) {
if (mLastAnimationTarget == targetSet) {
mLastAnimationRunning = false;
}
}
public RecentsAnimationListenerSet newRecentsAnimationListenerSet() {
public RecentsAnimationCallbacks newRecentsAnimationListenerSet() {
Preconditions.assertUIThread();
if (mLastAnimationRunning) {
@@ -134,17 +137,17 @@ public class SwipeSharedState implements SwipeAnimationListener {
clearListenerState(false /* finishAnimation */);
boolean shouldMinimiseSplitScreen = mOverviewComponentObserver == null ? false
: mOverviewComponentObserver.getActivityControlHelper().shouldMinimizeSplitScreen();
mRecentsAnimationListener = new RecentsAnimationListenerSet(
mRecentsAnimationListener = new RecentsAnimationCallbacks(
shouldMinimiseSplitScreen, this::onSwipeAnimationFinished);
mRecentsAnimationListener.addListener(this);
return mRecentsAnimationListener;
}
public RecentsAnimationListenerSet getActiveListener() {
public RecentsAnimationCallbacks getActiveListener() {
return mRecentsAnimationListener;
}
public void applyActiveRecentsAnimationState(SwipeAnimationListener listener) {
public void applyActiveRecentsAnimationState(RecentsAnimationListener listener) {
if (mLastAnimationTarget != null) {
listener.onRecentsAnimationStart(mLastAnimationTarget);
} else if (mLastAnimationCancelled) {
@@ -31,9 +31,9 @@ import com.android.launcher3.BaseActivity;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Utilities;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.AppWindowAnimationHelper;
import com.android.quickstep.util.MultiValueUpdateListener;
import com.android.quickstep.util.RemoteAnimationTargetSet;
import com.android.quickstep.util.RemoteAnimationTargets;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.Task;
@@ -118,16 +118,17 @@ public final class TaskViewUtils {
*/
public static ValueAnimator getRecentsWindowAnimator(TaskView v, boolean skipViewChanges,
RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets, final ClipAnimationHelper inOutHelper) {
RemoteAnimationTargetCompat[] wallpaperTargets, final AppWindowAnimationHelper inOutHelper) {
SyncRtSurfaceTransactionApplierCompat applier =
new SyncRtSurfaceTransactionApplierCompat(v);
final RemoteAnimationTargetSet targetSet =
new RemoteAnimationTargetSet(appTargets, wallpaperTargets, MODE_OPENING);
final RemoteAnimationTargets targetSet =
new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_OPENING);
targetSet.addDependentTransactionApplier(applier);
ClipAnimationHelper.TransformParams params = new ClipAnimationHelper.TransformParams()
.setSyncTransactionApplier(applier)
.setTargetSet(targetSet)
.setLauncherOnTop(true);
AppWindowAnimationHelper.TransformParams params =
new AppWindowAnimationHelper.TransformParams()
.setSyncTransactionApplier(applier)
.setTargetSet(targetSet)
.setLauncherOnTop(true);
final RecentsView recentsView = v.getRecentsView();
final ValueAnimator appAnimator = ValueAnimator.ofFloat(0, 1);
@@ -165,19 +166,19 @@ public final class TaskViewUtils {
// Append the surface transform params for the app that's being opened.
Collections.addAll(surfaceParamsList, inOutHelper.getSurfaceParams(params));
ClipAnimationHelper liveTileClipAnimationHelper =
AppWindowAnimationHelper liveTileAnimationHelper =
v.getRecentsView().getClipAnimationHelper();
if (liveTileClipAnimationHelper != null) {
if (liveTileAnimationHelper != null) {
// Append the surface transform params for the live tile app.
ClipAnimationHelper.TransformParams liveTileParams =
AppWindowAnimationHelper.TransformParams liveTileParams =
v.getRecentsView().getLiveTileParams(true /* mightNeedToRefill */);
if (liveTileParams != null) {
Collections.addAll(surfaceParamsList,
liveTileClipAnimationHelper.getSurfaceParams(liveTileParams));
liveTileAnimationHelper.getSurfaceParams(liveTileParams));
}
}
// Apply surface transform using the surface params list.
ClipAnimationHelper.applySurfaceParams(params.syncTransactionApplier,
AppWindowAnimationHelper.applySurfaceParams(params.syncTransactionApplier,
surfaceParamsList.toArray(new SurfaceParams[surfaceParamsList.size()]));
// Get the task bounds for the app that's being opened after surface transform
// update.
@@ -84,7 +84,7 @@ import com.android.launcher3.util.DefaultDisplay;
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.SysUINavigationMode.NavigationModeChangeListener;
import com.android.quickstep.inputconsumers.AccessibilityInputConsumer;
import com.android.quickstep.inputconsumers.AssistantTouchConsumer;
import com.android.quickstep.inputconsumers.AssistantInputConsumer;
import com.android.quickstep.inputconsumers.DeviceLockedInputConsumer;
import com.android.quickstep.inputconsumers.FallbackNoButtonInputConsumer;
import com.android.quickstep.inputconsumers.InputConsumer;
@@ -563,7 +563,7 @@ public class TouchInteractionService extends Service implements
// not interrupt it. QuickSwitch assumes that interruption can only happen if the
// next gesture is also quick switch.
mUncheckedConsumer =
new AssistantTouchConsumer(this, mISystemUiProxy,
new AssistantInputConsumer(this, mISystemUiProxy,
mOverviewComponentObserver.getActivityControlHelper(),
InputConsumer.NO_OP, mInputMonitorCompat);
} else {
@@ -613,7 +613,7 @@ public class TouchInteractionService extends Service implements
final ActivityControlHelper activityControl =
mOverviewComponentObserver.getActivityControlHelper();
if (canTriggerAssistantAction(event)) {
base = new AssistantTouchConsumer(this, mISystemUiProxy, activityControl, base,
base = new AssistantInputConsumer(this, mISystemUiProxy, activityControl, base,
mInputMonitorCompat);
}
@@ -79,9 +79,9 @@ import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory;
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.inputconsumers.InputConsumer;
import com.android.quickstep.inputconsumers.OverviewInputConsumer;
import com.android.quickstep.util.ClipAnimationHelper.TargetAlphaProvider;
import com.android.quickstep.util.AppWindowAnimationHelper.TargetAlphaProvider;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.quickstep.util.SwipeAnimationTargetSet;
import com.android.quickstep.util.RecentsAnimationTargets;
import com.android.quickstep.views.LiveTileOverlay;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
@@ -547,7 +547,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
@Override
public void updateFinalShift() {
SwipeAnimationTargetSet controller = mRecentsAnimationWrapper.getController();
RecentsAnimationTargets controller = mRecentsAnimationWrapper.getController();
if (controller != null) {
applyTransformUnchecked();
updateSysUiFlags(mCurrentShift.value);
@@ -555,8 +555,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
if (mRecentsAnimationWrapper.getController() != null) {
mLiveTileOverlay.update(mClipAnimationHelper.getCurrentRectWithInsets(),
mClipAnimationHelper.getCurrentCornerRadius());
mLiveTileOverlay.update(mAppWindowAnimationHelper.getCurrentRectWithInsets(),
mAppWindowAnimationHelper.getCurrentCornerRadius());
}
}
@@ -605,7 +605,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
}
@Override
public void onRecentsAnimationStart(SwipeAnimationTargetSet targetSet) {
public void onRecentsAnimationStart(RecentsAnimationTargets targetSet) {
super.onRecentsAnimationStart(targetSet);
TOUCH_INTERACTION_LOG.addLog("startRecentsAnimationCallback", targetSet.apps.length);
setStateOnUiThread(STATE_APP_CONTROLLER_RECEIVED);
@@ -886,7 +886,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
@NonNull
@Override
public RectF getWindowTargetRect() {
RectF fallbackTarget = new RectF(mClipAnimationHelper.getTargetRect());
RectF fallbackTarget = new RectF(mAppWindowAnimationHelper.getTargetRect());
Utilities.scaleRectFAboutCenter(fallbackTarget, 0.25f);
return fallbackTarget;
}
@@ -1108,7 +1108,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
}
private void switchToScreenshot() {
SwipeAnimationTargetSet controller = mRecentsAnimationWrapper.getController();
RecentsAnimationTargets controller = mRecentsAnimationWrapper.getController();
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
if (controller != null) {
// Update the screenshot of the task
@@ -1191,7 +1191,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
}
private void setTargetAlphaProvider(TargetAlphaProvider provider) {
mClipAnimationHelper.setTaskAlphaCallback(provider);
mAppWindowAnimationHelper.setTaskAlphaCallback(provider);
updateFinalShift();
}
@@ -142,7 +142,7 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity> {
mZoomTranslationY = 0f;
} else {
TaskView dummyTask = getTaskViewAt(0);
ScaleAndTranslation sat = getTempClipAnimationHelper()
ScaleAndTranslation sat = getTempAppWindowAnimationHelper()
.updateForFullscreenOverview(dummyTask)
.getScaleAndTranslation();
mZoomScale = sat.scale;
@@ -57,9 +57,9 @@ import com.android.systemui.shared.system.InputMonitorCompat;
/**
* Touch consumer for handling events to launch assistant from launcher
*/
public class AssistantTouchConsumer extends DelegateInputConsumer {
public class AssistantInputConsumer extends DelegateInputConsumer {
private static final String TAG = "AssistantTouchConsumer";
private static final String TAG = "AssistantInputConsumer";
private static final long RETRACT_ANIMATION_DURATION_MS = 300;
// From //java/com/google/android/apps/gsa/search/shared/util/OpaContract.java.
@@ -92,7 +92,7 @@ public class AssistantTouchConsumer extends DelegateInputConsumer {
private final Context mContext;
private final GestureDetector mGestureDetector;
public AssistantTouchConsumer(Context context, ISystemUiProxy systemUiProxy,
public AssistantInputConsumer(Context context, ISystemUiProxy systemUiProxy,
ActivityControlHelper activityControlHelper, InputConsumer delegate,
InputMonitorCompat inputMonitor) {
super(delegate, inputMonitor);
@@ -43,9 +43,10 @@ import com.android.launcher3.util.DefaultDisplay;
import com.android.quickstep.LockScreenRecentsActivity;
import com.android.quickstep.MultiStateCallback;
import com.android.quickstep.SwipeSharedState;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.RecentsAnimationListenerSet;
import com.android.quickstep.util.SwipeAnimationTargetSet;
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.system.InputMonitorCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -54,7 +55,7 @@ import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
* A dummy input consumer used when the device is still locked, e.g. from secure camera.
*/
public class DeviceLockedInputConsumer implements InputConsumer,
SwipeAnimationTargetSet.SwipeAnimationListener {
RecentsAnimationCallbacks.RecentsAnimationListener {
private static final float SCALE_DOWN = 0.75f;
@@ -77,9 +78,9 @@ public class DeviceLockedInputConsumer implements InputConsumer,
private final InputMonitorCompat mInputMonitorCompat;
private final PointF mTouchDown = new PointF();
private final ClipAnimationHelper mClipAnimationHelper;
private final AppWindowAnimationHelper mAppWindowAnimationHelper;
private int mLogId;
private final ClipAnimationHelper.TransformParams mTransformParams;
private final AppWindowAnimationHelper.TransformParams mTransformParams;
private final Point mDisplaySize;
private final MultiStateCallback mStateCallback;
private final RectF mSwipeTouchRegion;
@@ -90,7 +91,7 @@ public class DeviceLockedInputConsumer implements InputConsumer,
private boolean mThresholdCrossed = false;
private SwipeAnimationTargetSet mTargetSet;
private RecentsAnimationTargets mTargetSet;
public DeviceLockedInputConsumer(Context context, SwipeSharedState swipeSharedState,
InputMonitorCompat inputMonitorCompat, RectF swipeTouchRegion, int runningTaskId,
@@ -98,9 +99,9 @@ public class DeviceLockedInputConsumer implements InputConsumer,
mContext = context;
mTouchSlopSquared = squaredTouchSlop(context);
mSwipeSharedState = swipeSharedState;
mClipAnimationHelper = new ClipAnimationHelper(context);
mAppWindowAnimationHelper = new AppWindowAnimationHelper(context);
mLogId = logId;
mTransformParams = new ClipAnimationHelper.TransformParams();
mTransformParams = new AppWindowAnimationHelper.TransformParams();
mInputMonitorCompat = inputMonitorCompat;
mSwipeTouchRegion = swipeTouchRegion;
mRunningTaskId = runningTaskId;
@@ -156,7 +157,7 @@ public class DeviceLockedInputConsumer implements InputConsumer,
float dy = Math.max(mTouchDown.y - y, 0);
mProgress = dy / mDisplaySize.y;
mTransformParams.setProgress(mProgress);
mClipAnimationHelper.applyTransform(mTransformParams);
mAppWindowAnimationHelper.applyTransform(mTransformParams);
}
break;
}
@@ -201,7 +202,7 @@ public class DeviceLockedInputConsumer implements InputConsumer,
private void startRecentsTransition() {
mThresholdCrossed = true;
RecentsAnimationListenerSet newListenerSet =
RecentsAnimationCallbacks newListenerSet =
mSwipeSharedState.newRecentsAnimationListenerSet();
newListenerSet.addListener(this);
Intent intent = new Intent(Intent.ACTION_MAIN)
@@ -215,20 +216,21 @@ public class DeviceLockedInputConsumer implements InputConsumer,
}
@Override
public void onRecentsAnimationStart(SwipeAnimationTargetSet targetSet) {
public void onRecentsAnimationStart(RecentsAnimationTargets targetSet) {
mTargetSet = targetSet;
Rect displaySize = new Rect(0, 0, mDisplaySize.x, mDisplaySize.y);
RemoteAnimationTargetCompat targetCompat = targetSet.findTask(mRunningTaskId);
if (targetCompat != null) {
mClipAnimationHelper.updateSource(displaySize, targetCompat);
mAppWindowAnimationHelper.updateSource(displaySize, targetCompat);
}
Utilities.scaleRectAboutCenter(displaySize, SCALE_DOWN);
displaySize.offsetTo(displaySize.left, 0);
mClipAnimationHelper.updateTargetRect(displaySize);
mTransformParams.setTargetSet(mTargetSet).setLauncherOnTop(true);
mClipAnimationHelper.applyTransform(mTransformParams);
mTransformParams.setTargetSet(mTargetSet)
.setLauncherOnTop(true);
mAppWindowAnimationHelper.updateTargetRect(displaySize);
mAppWindowAnimationHelper.applyTransform(mTransformParams);
mStateCallback.setState(STATE_TARGET_RECEIVED);
}
@@ -49,7 +49,7 @@ import com.android.quickstep.RecentsModel;
import com.android.quickstep.SwipeSharedState;
import com.android.quickstep.fallback.FallbackRecentsView;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.quickstep.util.SwipeAnimationTargetSet;
import com.android.quickstep.util.RecentsAnimationTargets;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -127,9 +127,9 @@ public class FallbackNoButtonInputConsumer extends
mSwipeUpOverHome = mRunningOverHome && !mInQuickSwitchMode;
if (mSwipeUpOverHome) {
mClipAnimationHelper.setBaseAlphaCallback((t, a) -> 1 - mLauncherAlpha.value);
mAppWindowAnimationHelper.setBaseAlphaCallback((t, a) -> 1 - mLauncherAlpha.value);
} else {
mClipAnimationHelper.setBaseAlphaCallback((t, a) -> mLauncherAlpha.value);
mAppWindowAnimationHelper.setBaseAlphaCallback((t, a) -> mLauncherAlpha.value);
}
initStateCallbacks();
@@ -414,12 +414,12 @@ public class FallbackNoButtonInputConsumer extends
}
@Override
public void onRecentsAnimationStart(SwipeAnimationTargetSet targetSet) {
public void onRecentsAnimationStart(RecentsAnimationTargets targetSet) {
super.onRecentsAnimationStart(targetSet);
mRecentsAnimationWrapper.enableInputConsumer();
if (mRunningOverHome) {
mClipAnimationHelper.prepareAnimation(mDp, true);
mAppWindowAnimationHelper.prepareAnimation(mDp, true);
}
applyTransformUnchecked();
@@ -61,7 +61,7 @@ import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.util.CachedEventDispatcher;
import com.android.quickstep.util.MotionPauseDetector;
import com.android.quickstep.util.NavBarPosition;
import com.android.quickstep.util.RecentsAnimationListenerSet;
import com.android.quickstep.util.RecentsAnimationCallbacks;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.InputMonitorCompat;
@@ -329,7 +329,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
long touchTimeMs, boolean isLikelyToStartNewTask) {
TOUCH_INTERACTION_LOG.addLog("startRecentsAnimation");
RecentsAnimationListenerSet listenerSet = mSwipeSharedState.getActiveListener();
RecentsAnimationCallbacks listenerSet = mSwipeSharedState.getActiveListener();
final BaseSwipeUpHandler handler = mHandlerFactory.newHandler(mRunningTask, touchTimeMs,
listenerSet != null, isLikelyToStartNewTask);
@@ -343,7 +343,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
mSwipeSharedState.applyActiveRecentsAnimationState(handler);
notifyGestureStarted();
} else {
RecentsAnimationListenerSet newListenerSet =
RecentsAnimationCallbacks newListenerSet =
mSwipeSharedState.newRecentsAnimationListenerSet();
newListenerSet.addListener(handler);
Intent intent = handler.getLaunchIntent();
@@ -416,7 +416,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
}
private void removeListener() {
RecentsAnimationListenerSet listenerSet = mSwipeSharedState.getActiveListener();
RecentsAnimationCallbacks listenerSet = mSwipeSharedState.getActiveListener();
if (listenerSet != null) {
listenerSet.removeListener(mInteractionHandler);
}
@@ -50,13 +50,11 @@ import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.
import com.android.systemui.shared.system.TransactionCompat;
import com.android.systemui.shared.system.WindowManagerWrapper;
import java.util.function.BiFunction;
/**
* Utility class to handle window clip animation
*/
@TargetApi(Build.VERSION_CODES.P)
public class ClipAnimationHelper {
public class AppWindowAnimationHelper {
// The bounds of the source app in device coordinates
private final Rect mSourceStackBounds = new Rect();
@@ -102,7 +100,7 @@ public class ClipAnimationHelper {
private TargetAlphaProvider mTaskAlphaCallback = (t, a) -> a;
private TargetAlphaProvider mBaseAlphaCallback = (t, a) -> 1;
public ClipAnimationHelper(Context context) {
public AppWindowAnimationHelper(Context context) {
mWindowCornerRadius = getWindowCornerRadius(context.getResources());
mSupportsRoundedCornersOnWindows = supportsRoundedCornersOnWindows(context.getResources());
mTaskCornerRadius = TaskCornerRadius.get(context);
@@ -319,7 +317,7 @@ public class ClipAnimationHelper {
/**
* Compute scale and translation y such that the specified task view fills the screen.
*/
public ClipAnimationHelper updateForFullscreenOverview(TaskView v) {
public AppWindowAnimationHelper updateForFullscreenOverview(TaskView v) {
TaskThumbnailView thumbnailView = v.getThumbnail();
RecentsView recentsView = v.getRecentsView();
fromTaskThumbnailView(thumbnailView, recentsView);
@@ -395,7 +393,7 @@ public class ClipAnimationHelper {
float cornerRadius;
boolean launcherOnTop;
public RemoteAnimationTargetSet targetSet;
public RemoteAnimationTargets targetSet;
public SyncRtSurfaceTransactionApplierCompat syncTransactionApplier;
public TransformParams() {
@@ -446,7 +444,7 @@ public class ClipAnimationHelper {
return this;
}
public TransformParams setTargetSet(RemoteAnimationTargetSet targetSet) {
public TransformParams setTargetSet(RemoteAnimationTargets targetSet) {
this.targetSet = targetSet;
return this;
}
@@ -26,30 +26,29 @@ import androidx.annotation.UiThread;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.Preconditions;
import com.android.quickstep.TouchInteractionService;
import com.android.quickstep.util.SwipeAnimationTargetSet.SwipeAnimationListener;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
import com.android.systemui.shared.system.RecentsAnimationListener;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import java.util.Set;
import java.util.function.Consumer;
/**
* Wrapper around {@link RecentsAnimationListener} which delegates callbacks to multiple listeners
* Wrapper around {@link com.android.systemui.shared.system.RecentsAnimationListener} which delegates callbacks to multiple listeners
* on the main thread
*/
public class RecentsAnimationListenerSet implements RecentsAnimationListener {
public class RecentsAnimationCallbacks implements
com.android.systemui.shared.system.RecentsAnimationListener {
private final Set<SwipeAnimationListener> mListeners = new ArraySet<>();
private final Set<RecentsAnimationListener> mListeners = new ArraySet<>();
private final boolean mShouldMinimizeSplitScreen;
private final Consumer<SwipeAnimationTargetSet> mOnFinishListener;
private final Consumer<RecentsAnimationTargets> mOnFinishListener;
private RecentsAnimationControllerCompat mController;
private boolean mCancelled;
public RecentsAnimationListenerSet(boolean shouldMinimizeSplitScreen,
Consumer<SwipeAnimationTargetSet> onFinishListener) {
public RecentsAnimationCallbacks(boolean shouldMinimizeSplitScreen,
Consumer<RecentsAnimationTargets> onFinishListener) {
mShouldMinimizeSplitScreen = shouldMinimizeSplitScreen;
mOnFinishListener = onFinishListener;
TouchInteractionService.getSwipeSharedState().setRecentsAnimationCanceledCallback(
@@ -57,13 +56,13 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener {
}
@UiThread
public void addListener(SwipeAnimationListener listener) {
public void addListener(RecentsAnimationListener listener) {
Preconditions.assertUIThread();
mListeners.add(listener);
}
@UiThread
public void removeListener(SwipeAnimationListener listener) {
public void removeListener(RecentsAnimationListener listener) {
Preconditions.assertUIThread();
mListeners.remove(listener);
}
@@ -75,7 +74,7 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener {
RemoteAnimationTargetCompat[] wallpaperTargets,
Rect homeContentInsets, Rect minimizedHomeBounds) {
mController = controller;
SwipeAnimationTargetSet targetSet = new SwipeAnimationTargetSet(controller, appTargets,
RecentsAnimationTargets targetSet = new RecentsAnimationTargets(controller, appTargets,
wallpaperTargets, homeContentInsets, minimizedHomeBounds,
mShouldMinimizeSplitScreen, mOnFinishListener);
@@ -83,7 +82,7 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener {
targetSet.cancelAnimation();
} else {
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
for (SwipeAnimationListener listener : getListeners()) {
for (RecentsAnimationListener listener : getListeners()) {
listener.onRecentsAnimationStart(targetSet);
}
});
@@ -104,18 +103,31 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener {
@Override
public final void onAnimationCanceled(ThumbnailData thumbnailData) {
Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> {
for (SwipeAnimationListener listener : getListeners()) {
for (RecentsAnimationListener listener : getListeners()) {
listener.onRecentsAnimationCanceled(thumbnailData);
}
});
}
private SwipeAnimationListener[] getListeners() {
return mListeners.toArray(new SwipeAnimationListener[mListeners.size()]);
private RecentsAnimationListener[] getListeners() {
return mListeners.toArray(new RecentsAnimationListener[mListeners.size()]);
}
public void cancelListener() {
mCancelled = true;
onAnimationCanceled(null);
}
/**
* Listener for the recents animation callbacks.
*/
public interface RecentsAnimationListener {
void onRecentsAnimationStart(RecentsAnimationTargets targetSet);
/**
* Callback from the system when the recents animation is canceled. {@param thumbnailData}
* is passed back for rendering screenshot to replace live tile.
*/
void onRecentsAnimationCanceled(ThumbnailData thumbnailData);
}
}
@@ -28,22 +28,22 @@ import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import java.util.function.Consumer;
/**
* Extension of {@link RemoteAnimationTargetSet} with additional information about swipe
* Extension of {@link RemoteAnimationTargets} with additional information about swipe
* up animation
*/
public class SwipeAnimationTargetSet extends RemoteAnimationTargetSet {
public class RecentsAnimationTargets extends RemoteAnimationTargets {
private final boolean mShouldMinimizeSplitScreen;
private final Consumer<SwipeAnimationTargetSet> mOnFinishListener;
private final Consumer<RecentsAnimationTargets> mOnFinishListener;
public final RecentsAnimationControllerCompat controller;
public final Rect homeContentInsets;
public final Rect minimizedHomeBounds;
public SwipeAnimationTargetSet(RecentsAnimationControllerCompat controller,
public RecentsAnimationTargets(RecentsAnimationControllerCompat controller,
RemoteAnimationTargetCompat[] apps, RemoteAnimationTargetCompat[] wallpapers,
Rect homeContentInsets, Rect minimizedHomeBounds, boolean shouldMinimizeSplitScreen,
Consumer<SwipeAnimationTargetSet> onFinishListener) {
Consumer<RecentsAnimationTargets> onFinishListener) {
super(apps, wallpapers, MODE_CLOSING);
this.controller = controller;
this.homeContentInsets = homeContentInsets;
@@ -60,8 +60,8 @@ public class SwipeAnimationTargetSet extends RemoteAnimationTargetSet {
* Clones the target set without any actual targets. Used only when continuing a gesture after
* the actual recents animation has finished.
*/
public SwipeAnimationTargetSet cloneWithoutTargets() {
return new SwipeAnimationTargetSet(controller, new RemoteAnimationTargetCompat[0],
public RecentsAnimationTargets cloneWithoutTargets() {
return new RecentsAnimationTargets(controller, new RemoteAnimationTargetCompat[0],
new RemoteAnimationTargetCompat[0], homeContentInsets, minimizedHomeBounds,
mShouldMinimizeSplitScreen, mOnFinishListener);
}
@@ -109,15 +109,4 @@ public class SwipeAnimationTargetSet extends RemoteAnimationTargetSet {
public void finishAnimation() {
finishController(true /* toRecents */, null, false /* sendUserLeaveHint */);
}
public interface SwipeAnimationListener {
void onRecentsAnimationStart(SwipeAnimationTargetSet targetSet);
/**
* Callback from the system when the recents animation is canceled. {@param thumbnailData}
* is passed back for rendering screenshot to replace live tile.
*/
void onRecentsAnimationCanceled(ThumbnailData thumbnailData);
}
}
@@ -48,8 +48,8 @@ import com.android.launcher3.appprediction.PredictionUiStateManager.Client;
import com.android.launcher3.uioverrides.DejankBinderTracker;
import com.android.launcher3.views.ScrimView;
import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.ClipAnimationHelper.TransformParams;
import com.android.quickstep.util.AppWindowAnimationHelper;
import com.android.quickstep.util.AppWindowAnimationHelper.TransformParams;
import com.android.quickstep.util.LayoutUtils;
/**
@@ -120,7 +120,7 @@ public class LauncherRecentsView extends RecentsView<Launcher> implements StateL
*/
@Override
public AnimatorSet createAdjacentPageAnimForTaskLaunch(TaskView tv,
ClipAnimationHelper helper) {
AppWindowAnimationHelper helper) {
AnimatorSet anim = super.createAdjacentPageAnimForTaskLaunch(tv, helper);
if (!SysUINavigationMode.getMode(mActivity).hasGestures) {
@@ -178,7 +178,7 @@ public class LauncherRecentsView extends RecentsView<Launcher> implements StateL
mTransformParams.setProgress(1 - progress)
.setSyncTransactionApplier(mSyncTransactionApplier)
.setForLiveTile(true);
mClipAnimationHelper.applyTransform(mTransformParams);
mAppWindowAnimationHelper.applyTransform(mTransformParams);
} else {
redrawLiveTile(true);
}
@@ -211,17 +211,17 @@ public class LauncherRecentsView extends RecentsView<Launcher> implements StateL
@Override
public void redrawLiveTile(boolean mightNeedToRefill) {
ClipAnimationHelper.TransformParams transformParams = getLiveTileParams(mightNeedToRefill);
AppWindowAnimationHelper.TransformParams transformParams = getLiveTileParams(mightNeedToRefill);
if (transformParams != null) {
mClipAnimationHelper.applyTransform(transformParams);
mAppWindowAnimationHelper.applyTransform(transformParams);
}
}
@Override
public ClipAnimationHelper.TransformParams getLiveTileParams(
public AppWindowAnimationHelper.TransformParams getLiveTileParams(
boolean mightNeedToRefill) {
if (!mEnableDrawingLiveTile || mRecentsAnimationWrapper == null
|| mClipAnimationHelper == null) {
|| mAppWindowAnimationHelper == null) {
return null;
}
TaskView taskView = getRunningTaskView();
@@ -107,7 +107,7 @@ import com.android.quickstep.RecentsModel.TaskThumbnailChangeListener;
import com.android.quickstep.TaskThumbnailCache;
import com.android.quickstep.TaskUtils;
import com.android.quickstep.ViewUtils;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.AppWindowAnimationHelper;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
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 ClipAnimationHelper mClipAnimationHelper;
protected AppWindowAnimationHelper mAppWindowAnimationHelper;
protected SyncRtSurfaceTransactionApplierCompat mSyncTransactionApplier;
protected int mTaskWidth;
protected int mTaskHeight;
@@ -176,7 +176,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
private final ClearAllButton mClearAllButton;
private final Rect mClearAllButtonDeadZoneRect = new Rect();
private final Rect mTaskViewDeadZoneRect = new Rect();
protected final ClipAnimationHelper mTempClipAnimationHelper;
protected final AppWindowAnimationHelper mTempAppWindowAnimationHelper;
private final ScrollState mScrollState = new ScrollState();
// Keeps track of the previously known visible tasks for purposes of loading/unloading task data
@@ -327,7 +327,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
mActivity = (T) BaseActivity.fromContext(context);
mModel = RecentsModel.INSTANCE.get(context);
mIdp = InvariantDeviceProfile.INSTANCE.get(context);
mTempClipAnimationHelper = new ClipAnimationHelper(context);
mTempAppWindowAnimationHelper = new AppWindowAnimationHelper(context);
mClearAllButton = (ClearAllButton) LayoutInflater.from(context)
.inflate(R.layout.overview_clear_all_button, this, false);
@@ -808,7 +808,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
mTaskListChangeId = -1;
mRecentsAnimationWrapper = null;
mClipAnimationHelper = null;
mAppWindowAnimationHelper = null;
unloadVisibleTaskData();
setCurrentPage(0);
@@ -1519,14 +1519,14 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
* to the right.
*/
public AnimatorSet createAdjacentPageAnimForTaskLaunch(
TaskView tv, ClipAnimationHelper clipAnimationHelper) {
TaskView tv, AppWindowAnimationHelper appWindowAnimationHelper) {
AnimatorSet anim = new AnimatorSet();
int taskIndex = indexOfChild(tv);
int centerTaskIndex = getCurrentPage();
boolean launchingCenterTask = taskIndex == centerTaskIndex;
LauncherState.ScaleAndTranslation toScaleAndTranslation = clipAnimationHelper
LauncherState.ScaleAndTranslation toScaleAndTranslation = appWindowAnimationHelper
.getScaleAndTranslation();
float toScale = toScaleAndTranslation.scale;
float toTranslationY = toScaleAndTranslation.translationY;
@@ -1586,10 +1586,10 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
}
});
ClipAnimationHelper clipAnimationHelper = new ClipAnimationHelper(mActivity);
clipAnimationHelper.fromTaskThumbnailView(tv.getThumbnail(), this);
clipAnimationHelper.prepareAnimation(mActivity.getDeviceProfile(), true /* isOpening */);
AnimatorSet anim = createAdjacentPageAnimForTaskLaunch(tv, clipAnimationHelper);
AppWindowAnimationHelper appWindowAnimationHelper = new AppWindowAnimationHelper(mActivity);
appWindowAnimationHelper.fromTaskThumbnailView(tv.getThumbnail(), this);
appWindowAnimationHelper.prepareAnimation(mActivity.getDeviceProfile(), true /* isOpening */);
AnimatorSet anim = createAdjacentPageAnimForTaskLaunch(tv, appWindowAnimationHelper);
anim.play(progressAnim);
anim.setDuration(duration);
@@ -1696,8 +1696,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
mRecentsAnimationWrapper = recentsAnimationWrapper;
}
public void setClipAnimationHelper(ClipAnimationHelper clipAnimationHelper) {
mClipAnimationHelper = clipAnimationHelper;
public void setAppWindowAnimationHelper(AppWindowAnimationHelper appWindowAnimationHelper) {
mAppWindowAnimationHelper = appWindowAnimationHelper;
}
public void setLiveTileOverlay(LiveTileOverlay liveTileOverlay) {
@@ -1805,15 +1805,15 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
}
}
public ClipAnimationHelper getClipAnimationHelper() {
return mClipAnimationHelper;
public AppWindowAnimationHelper getClipAnimationHelper() {
return mAppWindowAnimationHelper;
}
public ClipAnimationHelper getTempClipAnimationHelper() {
return mTempClipAnimationHelper;
public AppWindowAnimationHelper getTempAppWindowAnimationHelper() {
return mTempAppWindowAnimationHelper;
}
public ClipAnimationHelper.TransformParams getLiveTileParams(
public AppWindowAnimationHelper.TransformParams getLiveTileParams(
boolean mightNeedToRefill) {
return null;
}
@@ -71,7 +71,7 @@ import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
import com.android.launcher3.views.FloatingIconView;
import com.android.quickstep.util.MultiValueUpdateListener;
import com.android.quickstep.util.RemoteAnimationProvider;
import com.android.quickstep.util.RemoteAnimationTargetSet;
import com.android.quickstep.util.RemoteAnimationTargets;
import com.android.systemui.shared.system.ActivityCompat;
import com.android.systemui.shared.system.ActivityOptionsCompat;
import com.android.systemui.shared.system.QuickStepContract;
@@ -433,7 +433,7 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
Rect crop = new Rect();
Matrix matrix = new Matrix();
RemoteAnimationTargetSet openingTargets = new RemoteAnimationTargetSet(appTargets,
RemoteAnimationTargets openingTargets = new RemoteAnimationTargets(appTargets,
wallpaperTargets, MODE_OPENING);
SyncRtSurfaceTransactionApplierCompat surfaceApplier =
new SyncRtSurfaceTransactionApplierCompat(floatingView);
@@ -33,7 +33,7 @@ import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.quickstep.util.ActivityInitListener;
import com.android.quickstep.util.RemoteAnimationTargetSet;
import com.android.quickstep.util.RemoteAnimationTargets;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -112,7 +112,7 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> {
public final boolean shouldPreformHaptic;
}
default void onRemoteAnimationReceived(RemoteAnimationTargetSet targets) { }
default void onRemoteAnimationReceived(RemoteAnimationTargets targets) { }
void createActivityController(long transitionLength);
@@ -25,7 +25,7 @@ import java.util.Queue;
/**
* Holds a collection of RemoteAnimationTargets, filtered by different properties.
*/
public class RemoteAnimationTargetSet {
public class RemoteAnimationTargets {
private final Queue<SyncRtSurfaceTransactionApplierCompat> mDependentTransactionAppliers =
new ArrayDeque<>(1);
@@ -36,7 +36,7 @@ public class RemoteAnimationTargetSet {
public final int targetMode;
public final boolean hasRecents;
public RemoteAnimationTargetSet(RemoteAnimationTargetCompat[] apps,
public RemoteAnimationTargets(RemoteAnimationTargetCompat[] apps,
RemoteAnimationTargetCompat[] wallpapers, int targetMode) {
ArrayList<RemoteAnimationTargetCompat> filteredApps = new ArrayList<>();
boolean hasRecents = false;
@@ -29,12 +29,12 @@ import com.android.systemui.shared.system.TransactionCompat;
*/
public class RemoteFadeOutAnimationListener implements AnimatorUpdateListener {
private final RemoteAnimationTargetSet mTarget;
private final RemoteAnimationTargets mTarget;
private boolean mFirstFrame = true;
public RemoteFadeOutAnimationListener(RemoteAnimationTargetCompat[] appTargets,
RemoteAnimationTargetCompat[] wallpaperTargets) {
mTarget = new RemoteAnimationTargetSet(appTargets, wallpaperTargets, MODE_CLOSING);
mTarget = new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_CLOSING);
}
@Override