Loading go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java +6 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.util.TouchController; import com.android.quickstep.OverviewInteractionState; import com.android.quickstep.views.IconRecentsView; import java.util.ArrayList; Loading Loading @@ -87,7 +88,10 @@ public abstract class RecentsUiFactory { * * @param launcher the launcher activity */ public static void resetOverview(Launcher launcher) {} public static void resetOverview(Launcher launcher) { IconRecentsView recentsView = launcher.getOverviewPanel(); recentsView.setTransitionedFromApp(false); } /** * Recents logic that triggers when launcher state changes or launcher activity stops/resumes. Loading go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java +5 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import androidx.annotation.NonNull; import com.android.launcher3.BaseDraggingActivity; import com.android.quickstep.util.MultiValueUpdateListener; import com.android.quickstep.util.RemoteAnimationProvider; import com.android.quickstep.util.RemoteAnimationTargetSet; import com.android.quickstep.views.IconRecentsView; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat; Loading Loading @@ -100,6 +101,10 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple return anim; } RemoteAnimationTargetSet targetSet = new RemoteAnimationTargetSet(targetCompats, MODE_CLOSING); mRecentsView.setTransitionedFromApp(!targetSet.isAnimatingHome()); RemoteAnimationTargetCompat recentsTarget = null; RemoteAnimationTargetCompat closingAppTarget = null; Loading go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java +2 −2 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ public class OverviewCommandHelper { if (recents == null) { return false; } //TODO: Launch last running task or go to home. recents.handleOverviewCommand(); return true; } } Loading Loading @@ -146,7 +146,7 @@ public class OverviewCommandHelper { protected boolean handleCommand(long elapsedTime) { IconRecentsView recents = mHelper.getVisibleRecentsView(); if (recents != null) { //TODO: Launch next task in icon recents. recents.handleOverviewCommand(); return true; } else if (elapsedTime < ViewConfiguration.getDoubleTapTimeout()) { // The user tried to launch back into overview too quickly, either after Loading go/quickstep/src/com/android/quickstep/TaskHolder.java +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ import com.android.systemui.shared.recents.model.Task; * A recycler view holder that holds the task view and binds {@link Task} content (app title, icon, * etc.) to the view. */ final class TaskHolder extends ViewHolder { public final class TaskHolder extends ViewHolder { private final TaskItemView mTaskItemView; private Task mTask; Loading go/quickstep/src/com/android/quickstep/views/IconRecentsView.java +35 −1 Original line number Diff line number Diff line Loading @@ -35,8 +35,9 @@ import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver; import com.android.launcher3.R; import com.android.quickstep.RecentsToActivityHelper; import com.android.quickstep.TaskAdapter; import com.android.quickstep.TaskActionController; import com.android.quickstep.TaskAdapter; import com.android.quickstep.TaskHolder; import com.android.quickstep.TaskListLoader; import com.android.quickstep.TaskSwipeCallback; Loading Loading @@ -80,6 +81,7 @@ public final class IconRecentsView extends FrameLayout { private RecyclerView mTaskRecyclerView; private View mEmptyView; private View mContentView; private boolean mTransitionedFromApp; public IconRecentsView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -146,6 +148,38 @@ public final class IconRecentsView extends FrameLayout { }); } /** * Set whether we transitioned to recents from the most recent app. * * @param transitionedFromApp true if transitioned from the most recent app, false otherwise */ public void setTransitionedFromApp(boolean transitionedFromApp) { mTransitionedFromApp = transitionedFromApp; } /** * Handles input from the overview button. Launch the most recent task unless we just came from * the app. In that case, we launch the next most recent. */ public void handleOverviewCommand() { int childCount = mTaskRecyclerView.getChildCount(); if (childCount == 0) { // Do nothing return; } TaskHolder taskToLaunch; if (mTransitionedFromApp && childCount > 1) { // Launch the next most recent app TaskItemView itemView = (TaskItemView) mTaskRecyclerView.getChildAt(1); taskToLaunch = (TaskHolder) mTaskRecyclerView.getChildViewHolder(itemView); } else { // Launch the most recent app TaskItemView itemView = (TaskItemView) mTaskRecyclerView.getChildAt(0); taskToLaunch = (TaskHolder) mTaskRecyclerView.getChildViewHolder(itemView); } mTaskActionController.launchTask(taskToLaunch); } /** * Get the thumbnail view associated with a task for the purposes of animation. * Loading Loading
go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java +6 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.util.TouchController; import com.android.quickstep.OverviewInteractionState; import com.android.quickstep.views.IconRecentsView; import java.util.ArrayList; Loading Loading @@ -87,7 +88,10 @@ public abstract class RecentsUiFactory { * * @param launcher the launcher activity */ public static void resetOverview(Launcher launcher) {} public static void resetOverview(Launcher launcher) { IconRecentsView recentsView = launcher.getOverviewPanel(); recentsView.setTransitionedFromApp(false); } /** * Recents logic that triggers when launcher state changes or launcher activity stops/resumes. Loading
go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java +5 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import androidx.annotation.NonNull; import com.android.launcher3.BaseDraggingActivity; import com.android.quickstep.util.MultiValueUpdateListener; import com.android.quickstep.util.RemoteAnimationProvider; import com.android.quickstep.util.RemoteAnimationTargetSet; import com.android.quickstep.views.IconRecentsView; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat; Loading Loading @@ -100,6 +101,10 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple return anim; } RemoteAnimationTargetSet targetSet = new RemoteAnimationTargetSet(targetCompats, MODE_CLOSING); mRecentsView.setTransitionedFromApp(!targetSet.isAnimatingHome()); RemoteAnimationTargetCompat recentsTarget = null; RemoteAnimationTargetCompat closingAppTarget = null; Loading
go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java +2 −2 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ public class OverviewCommandHelper { if (recents == null) { return false; } //TODO: Launch last running task or go to home. recents.handleOverviewCommand(); return true; } } Loading Loading @@ -146,7 +146,7 @@ public class OverviewCommandHelper { protected boolean handleCommand(long elapsedTime) { IconRecentsView recents = mHelper.getVisibleRecentsView(); if (recents != null) { //TODO: Launch next task in icon recents. recents.handleOverviewCommand(); return true; } else if (elapsedTime < ViewConfiguration.getDoubleTapTimeout()) { // The user tried to launch back into overview too quickly, either after Loading
go/quickstep/src/com/android/quickstep/TaskHolder.java +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ import com.android.systemui.shared.recents.model.Task; * A recycler view holder that holds the task view and binds {@link Task} content (app title, icon, * etc.) to the view. */ final class TaskHolder extends ViewHolder { public final class TaskHolder extends ViewHolder { private final TaskItemView mTaskItemView; private Task mTask; Loading
go/quickstep/src/com/android/quickstep/views/IconRecentsView.java +35 −1 Original line number Diff line number Diff line Loading @@ -35,8 +35,9 @@ import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver; import com.android.launcher3.R; import com.android.quickstep.RecentsToActivityHelper; import com.android.quickstep.TaskAdapter; import com.android.quickstep.TaskActionController; import com.android.quickstep.TaskAdapter; import com.android.quickstep.TaskHolder; import com.android.quickstep.TaskListLoader; import com.android.quickstep.TaskSwipeCallback; Loading Loading @@ -80,6 +81,7 @@ public final class IconRecentsView extends FrameLayout { private RecyclerView mTaskRecyclerView; private View mEmptyView; private View mContentView; private boolean mTransitionedFromApp; public IconRecentsView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -146,6 +148,38 @@ public final class IconRecentsView extends FrameLayout { }); } /** * Set whether we transitioned to recents from the most recent app. * * @param transitionedFromApp true if transitioned from the most recent app, false otherwise */ public void setTransitionedFromApp(boolean transitionedFromApp) { mTransitionedFromApp = transitionedFromApp; } /** * Handles input from the overview button. Launch the most recent task unless we just came from * the app. In that case, we launch the next most recent. */ public void handleOverviewCommand() { int childCount = mTaskRecyclerView.getChildCount(); if (childCount == 0) { // Do nothing return; } TaskHolder taskToLaunch; if (mTransitionedFromApp && childCount > 1) { // Launch the next most recent app TaskItemView itemView = (TaskItemView) mTaskRecyclerView.getChildAt(1); taskToLaunch = (TaskHolder) mTaskRecyclerView.getChildViewHolder(itemView); } else { // Launch the most recent app TaskItemView itemView = (TaskItemView) mTaskRecyclerView.getChildAt(0); taskToLaunch = (TaskHolder) mTaskRecyclerView.getChildViewHolder(itemView); } mTaskActionController.launchTask(taskToLaunch); } /** * Get the thumbnail view associated with a task for the purposes of animation. * Loading