Merge "Enable returning to the previous app after Overview -> All Apps." into udc-qpr-dev
This commit is contained in:
@@ -519,7 +519,7 @@ public class QuickstepLauncher extends Launcher {
|
||||
}
|
||||
case QUICK_SWITCH_STATE_ORDINAL: {
|
||||
RecentsView rv = getOverviewPanel();
|
||||
TaskView tasktolaunch = rv.getTaskViewAt(0);
|
||||
TaskView tasktolaunch = rv.getCurrentPageTaskView();
|
||||
if (tasktolaunch != null) {
|
||||
tasktolaunch.launchTask(success -> {
|
||||
if (!success) {
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.content.Context;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.util.Themes;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
|
||||
@@ -110,7 +111,19 @@ public class AllAppsState extends LauncherState {
|
||||
|
||||
@Override
|
||||
public LauncherState getHistoryForState(LauncherState previousState) {
|
||||
return previousState == OVERVIEW ? OVERVIEW : NORMAL;
|
||||
return previousState == BACKGROUND_APP ? QUICK_SWITCH_FROM_HOME
|
||||
: previousState == OVERVIEW ? OVERVIEW : NORMAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] getOverviewScaleAndOffset(Launcher launcher) {
|
||||
if (!FeatureFlags.ENABLE_ALL_APPS_FROM_OVERVIEW.get()) {
|
||||
return super.getOverviewScaleAndOffset(launcher);
|
||||
}
|
||||
// This handles the case of returning to the previous app from Overview -> All Apps gesture.
|
||||
// This is the start scale/offset of overview that will be used for that transition.
|
||||
// TODO (b/283336332): Translate in Y direction (ideally with overview resistance).
|
||||
return new float[] {0.5f /* scale */, NO_OFFSET};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-1
@@ -29,6 +29,7 @@ import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.allapps.AllAppsTransitionController;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.states.StateAnimationConfig;
|
||||
import com.android.launcher3.touch.AbstractStateChangeTouchController;
|
||||
import com.android.launcher3.touch.AllAppsSwipeController;
|
||||
@@ -92,7 +93,9 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
@Override
|
||||
protected LauncherState getTargetState(LauncherState fromState, boolean isDragTowardPositive) {
|
||||
if (fromState == ALL_APPS && !isDragTowardPositive) {
|
||||
return NORMAL;
|
||||
return FeatureFlags.ENABLE_ALL_APPS_FROM_OVERVIEW.get()
|
||||
? mLauncher.getStateManager().getLastState()
|
||||
: NORMAL;
|
||||
} else if (fromState == OVERVIEW) {
|
||||
return isDragTowardPositive ? OVERVIEW : NORMAL;
|
||||
} else if (fromState == NORMAL && isDragTowardPositive) {
|
||||
|
||||
Reference in New Issue
Block a user