diff options
Diffstat (limited to 'go')
4 files changed, 88 insertions, 12 deletions
diff --git a/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java index d9b968603..b5fefb46d 100644 --- a/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java +++ b/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java @@ -21,10 +21,12 @@ import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import android.view.View; +import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherStateManager.StateHandler; import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; +import com.android.launcher3.graphics.RotationMode; import com.android.launcher3.uioverrides.touchcontrollers.LandscapeEdgeSwipeController; import com.android.launcher3.uioverrides.touchcontrollers.LandscapeStatesTouchController; import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController; @@ -102,4 +104,8 @@ public abstract class RecentsUiFactory { * @param launcher the launcher activity */ public static void onLauncherStateOrResumeChanged(Launcher launcher) {} + + public static RotationMode getRotationMode(DeviceProfile dp) { + return RotationMode.NORMAL; + } } diff --git a/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java b/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java index 64ee1a9f4..fe159b5f0 100644 --- a/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java +++ b/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java @@ -18,6 +18,7 @@ package com.android.quickstep; import static com.android.launcher3.Utilities.postAsyncCallback; import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import static com.android.quickstep.views.IconRecentsView.REMOTE_APP_TO_OVERVIEW_DURATION; +import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING; @@ -140,7 +141,11 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple return anim; } - mRecentsView.playRemoteAppToRecentsAnimation(anim, closingAppTarget, recentsTarget); + if (closingAppTarget.activityType == ACTIVITY_TYPE_HOME) { + mRecentsView.playRemoteHomeToRecentsAnimation(anim, closingAppTarget, recentsTarget); + } else { + mRecentsView.playRemoteAppToRecentsAnimation(anim, closingAppTarget, recentsTarget); + } return anim; } diff --git a/go/quickstep/src/com/android/quickstep/TaskActionController.java b/go/quickstep/src/com/android/quickstep/TaskActionController.java index 0e921c0db..f49fa3ef4 100644 --- a/go/quickstep/src/com/android/quickstep/TaskActionController.java +++ b/go/quickstep/src/com/android/quickstep/TaskActionController.java @@ -16,14 +16,17 @@ package com.android.quickstep; import static com.android.quickstep.TaskAdapter.TASKS_START_POSITION; +import static com.android.quickstep.TaskUtils.getLaunchComponentKeyForTask; import android.app.ActivityOptions; import android.view.View; import androidx.annotation.NonNull; +import com.android.launcher3.logging.StatsLogManager; import com.android.quickstep.views.TaskItemView; import com.android.systemui.shared.recents.model.Task; +import com.android.systemui.shared.recents.model.Task.TaskKey; import com.android.systemui.shared.system.ActivityManagerWrapper; /** @@ -34,10 +37,13 @@ public final class TaskActionController { private final TaskListLoader mLoader; private final TaskAdapter mAdapter; + private final StatsLogManager mStatsLogManager; - public TaskActionController(TaskListLoader loader, TaskAdapter adapter) { + public TaskActionController(TaskListLoader loader, TaskAdapter adapter, + StatsLogManager logManager) { mLoader = loader; mAdapter = adapter; + mStatsLogManager = logManager; } /** @@ -56,10 +62,11 @@ public final class TaskActionController { int width = v.getMeasuredWidth(); int height = v.getMeasuredHeight(); + TaskKey key = viewHolder.getTask().get().key; ActivityOptions opts = ActivityOptions.makeClipRevealAnimation(v, left, top, width, height); - ActivityManagerWrapper.getInstance().startActivityFromRecentsAsync( - viewHolder.getTask().get().key, opts, null /* resultCallback */, - null /* resultCallbackHandler */); + ActivityManagerWrapper.getInstance().startActivityFromRecentsAsync(key, opts, + null /* resultCallback */, null /* resultCallbackHandler */); + mStatsLogManager.logTaskLaunch(null /* view */, getLaunchComponentKeyForTask(key)); } /** @@ -71,6 +78,7 @@ public final class TaskActionController { ActivityOptions opts = ActivityOptions.makeBasic(); ActivityManagerWrapper.getInstance().startActivityFromRecentsAsync(task.key, opts, null /* resultCallback */, null /* resultCallbackHandler */); + mStatsLogManager.logTaskLaunch(null /* view */, getLaunchComponentKeyForTask(task.key)); } /** @@ -87,6 +95,7 @@ public final class TaskActionController { ActivityManagerWrapper.getInstance().removeTask(task.key.id); mLoader.removeTask(task); mAdapter.notifyItemRemoved(position); + // TODO(b/131840601): Add logging point for removal. } /** diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java index a53a06e86..bcb634393 100644 --- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java +++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java @@ -154,6 +154,7 @@ public final class IconRecentsView extends FrameLayout implements Insettable { private boolean mTransitionedFromApp; private boolean mUsingRemoteAnimation; private boolean mStartedEnterAnimation; + private boolean mShowStatusBarForegroundScrim; private AnimatorSet mLayoutAnimation; private final ArraySet<View> mLayingOutViews = new ArraySet<>(); private Rect mInsets; @@ -183,7 +184,8 @@ public final class IconRecentsView extends FrameLayout implements Insettable { mTaskLoader = new TaskListLoader(mContext); mTaskAdapter = new TaskAdapter(mTaskLoader); mTaskAdapter.setOnClearAllClickListener(view -> animateClearAllTasks()); - mTaskActionController = new TaskActionController(mTaskLoader, mTaskAdapter); + mTaskActionController = new TaskActionController(mTaskLoader, mTaskAdapter, + mActivity.getStatsLogManager()); mTaskAdapter.setActionController(mTaskActionController); mTaskLayoutManager = new LinearLayoutManager(mContext, VERTICAL, true /* reverseLayout */); RecentsModel.INSTANCE.get(context).addThumbnailChangeListener(listener); @@ -233,12 +235,8 @@ public final class IconRecentsView extends FrameLayout implements Insettable { case ITEM_TYPE_CLEAR_ALL: outRect.top = (int) res.getDimension( R.dimen.clear_all_item_view_top_margin); - int desiredBottomMargin = (int) res.getDimension( + outRect.bottom = (int) res.getDimension( R.dimen.clear_all_item_view_bottom_margin); - // Only add bottom margin if insets aren't enough. - if (mInsets.bottom < desiredBottomMargin) { - outRect.bottom = desiredBottomMargin - mInsets.bottom; - } break; case ITEM_TYPE_TASK: int desiredTopMargin = (int) res.getDimension( @@ -409,7 +407,14 @@ public final class IconRecentsView extends FrameLayout implements Insettable { * @param showStatusBarForegroundScrim true to show the scrim, false to hide */ public void setShowStatusBarForegroundScrim(boolean showStatusBarForegroundScrim) { - boolean shouldShow = mInsets.top != 0 && showStatusBarForegroundScrim; + mShowStatusBarForegroundScrim = showStatusBarForegroundScrim; + if (mShowStatusBarForegroundScrim != showStatusBarForegroundScrim) { + updateStatusBarScrim(); + } + } + + private void updateStatusBarScrim() { + boolean shouldShow = mInsets.top != 0 && mShowStatusBarForegroundScrim; mActivity.getDragLayer().setForeground(shouldShow ? mStatusBarForegroundScrim : null); } @@ -634,6 +639,53 @@ public final class IconRecentsView extends FrameLayout implements Insettable { } /** + * Play remote app to recents animation when the app is the home activity. We use a simple + * cross-fade here. Note this is only used if the home activity is a separate app than the + * recents activity. + * + * @param anim animator set + * @param homeTarget the home surface thats closing + * @param recentsTarget the surface containing recents + */ + public void playRemoteHomeToRecentsAnimation(@NonNull AnimatorSet anim, + @NonNull RemoteAnimationTargetCompat homeTarget, + @NonNull RemoteAnimationTargetCompat recentsTarget) { + SyncRtSurfaceTransactionApplierCompat surfaceApplier = + new SyncRtSurfaceTransactionApplierCompat(this); + + SurfaceParams[] params = new SurfaceParams[2]; + int boostedMode = MODE_CLOSING; + + ValueAnimator remoteHomeAnim = ValueAnimator.ofFloat(0, 1); + remoteHomeAnim.setDuration(REMOTE_APP_TO_OVERVIEW_DURATION); + + remoteHomeAnim.addUpdateListener(valueAnimator -> { + float val = (float) valueAnimator.getAnimatedValue(); + float alpha; + RemoteAnimationTargetCompat visibleTarget; + RemoteAnimationTargetCompat invisibleTarget; + if (val < .5f) { + visibleTarget = homeTarget; + invisibleTarget = recentsTarget; + alpha = 1 - (val * 2); + } else { + visibleTarget = recentsTarget; + invisibleTarget = homeTarget; + alpha = (val - .5f) * 2; + } + params[0] = new SurfaceParams(visibleTarget.leash, alpha, null /* matrix */, + null /* windowCrop */, getLayer(visibleTarget, boostedMode), + 0 /* cornerRadius */); + params[1] = new SurfaceParams(invisibleTarget.leash, 0.0f, null /* matrix */, + null /* windowCrop */, getLayer(invisibleTarget, boostedMode), + 0 /* cornerRadius */); + surfaceApplier.scheduleApply(params); + }); + anim.play(remoteHomeAnim); + animateFadeInLayoutAnimation(); + } + + /** * Play remote animation from app to recents. This should scale the currently closing app down * to the recents thumbnail. * @@ -650,6 +702,7 @@ public final class IconRecentsView extends FrameLayout implements Insettable { // enough time to take in the data change, bind a new view, and lay out the new view. // TODO: Have a fallback to animate to anim.play(ValueAnimator.ofInt(0, 1).setDuration(REMOTE_APP_TO_OVERVIEW_DURATION)); + return; } final Matrix appMatrix = new Matrix(); playRemoteTransYAnim(anim, appMatrix); @@ -838,6 +891,9 @@ public final class IconRecentsView extends FrameLayout implements Insettable { mInsets = insets; mTaskRecyclerView.setPadding(insets.left, insets.top, insets.right, insets.bottom); mTaskRecyclerView.invalidateItemDecorations(); + if (mInsets.top != 0) { + updateStatusBarScrim(); + } } /** |