Remove workspace card

Swiping up for recents scales down workspace and hides it, similar to the transition
to all apps. Simultaneously, recents slides in from the side.

Also removed the setting for swiping to the first task, as it is required now.

Change-Id: Id0845db6650a37917a4faa9c8a434a2270913904
This commit is contained in:
Tony
2018-03-09 22:01:47 +00:00
parent 5cd8ab938c
commit 404e625516
10 changed files with 58 additions and 136 deletions

View File

@@ -15,6 +15,13 @@
*/
package com.android.launcher3.uioverrides;
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.anim.Interpolators.DEACCEL_1_5;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
@@ -32,20 +39,13 @@ import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.touch.SwipeDetector;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
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.ContainerType;
import com.android.launcher3.util.TouchController;
import com.android.quickstep.RecentsView;
import com.android.quickstep.TaskView;
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.anim.Interpolators.DEACCEL_1_5;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity;
/**
* Touch controller for swipe interaction in Overview state
*/
@@ -132,28 +132,22 @@ public class OverviewSwipeController extends AnimatorListenerAdapter
mTaskBeingDragged = null;
mSwipeDownEnabled = true;
int currentPage = mRecentsView.getCurrentPage();
if (currentPage == 0) {
// User is on home tile
View view = mRecentsView.getChildAt(mRecentsView.getCurrentPage());
if (mLauncher.getDragLayer().isEventOverView(view, ev) &&
view instanceof TaskView) {
// The tile can be dragged down to open the task.
mTaskBeingDragged = (TaskView) view;
directionsToDetectScroll = SwipeDetector.DIRECTION_BOTH;
mStartingTarget = LauncherLogProto.ItemType.TASK;
} else if (isEventOverHotseat(ev)) {
// The hotseat is being dragged
directionsToDetectScroll = SwipeDetector.DIRECTION_POSITIVE;
mSwipeDownEnabled = false;
mStartingTarget = ContainerType.HOTSEAT;
} else {
View view = mRecentsView.getChildAt(currentPage);
if (mLauncher.getDragLayer().isEventOverView(view, ev) &&
view instanceof TaskView) {
// The tile can be dragged down to open the task.
mTaskBeingDragged = (TaskView) view;
directionsToDetectScroll = SwipeDetector.DIRECTION_BOTH;
mStartingTarget = LauncherLogProto.ItemType.TASK;
} else if (isEventOverHotseat(ev)) {
// The hotseat is being dragged
directionsToDetectScroll = SwipeDetector.DIRECTION_POSITIVE;
mSwipeDownEnabled = false;
mStartingTarget = ContainerType.HOTSEAT;
} else {
mNoIntercept = true;
mStartingTarget = ContainerType.WORKSPACE;
return false;
}
mNoIntercept = true;
mStartingTarget = ContainerType.WORKSPACE;
return false;
}
}