summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBecky Qiu <xuqiu@google.com>2019-08-01 16:00:47 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-08-01 16:00:47 -0700
commit9c6cfb4e04e0dc068834edf4c36cbda6b1c93b42 (patch)
tree2c5ef5ceb401443bddf9a3d91610132a8b956403
parent3ff3991f482ba4339f7521cda58040139e7c1aac (diff)
parent84fa94e2fc79aac983b5048caec84ce93a1302fc (diff)
downloadandroid_packages_apps_Trebuchet-9c6cfb4e04e0dc068834edf4c36cbda6b1c93b42.tar.gz
android_packages_apps_Trebuchet-9c6cfb4e04e0dc068834edf4c36cbda6b1c93b42.tar.bz2
android_packages_apps_Trebuchet-9c6cfb4e04e0dc068834edf4c36cbda6b1c93b42.zip
Fill the log container as hotseat or workspace based on position.
am: 84fa94e2fc Change-Id: If9a5d88062addbd09909e04ef5c2c59e7e5488a7
-rw-r--r--go/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/LandscapeStatesTouchController.java2
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/OverviewToAllAppsTouchController.java2
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java2
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/LandscapeEdgeSwipeController.java2
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java4
-rw-r--r--src/com/android/launcher3/touch/AbstractStateChangeTouchController.java26
-rw-r--r--src_ui_overrides/com/android/launcher3/uioverrides/AllAppsSwipeController.java2
7 files changed, 25 insertions, 15 deletions
diff --git a/go/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/LandscapeStatesTouchController.java b/go/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/LandscapeStatesTouchController.java
index 1ccd7d79a..66aec4050 100644
--- a/go/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/LandscapeStatesTouchController.java
+++ b/go/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/LandscapeStatesTouchController.java
@@ -64,7 +64,7 @@ public final class LandscapeStatesTouchController extends PortraitStatesTouchCon
}
@Override
- protected int getLogContainerTypeForNormalState() {
+ protected int getLogContainerTypeForNormalState(MotionEvent ev) {
return LauncherLogProto.ContainerType.WORKSPACE;
}
}
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/OverviewToAllAppsTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/OverviewToAllAppsTouchController.java
index 73f328bc1..90911684e 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/OverviewToAllAppsTouchController.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/OverviewToAllAppsTouchController.java
@@ -75,7 +75,7 @@ public class OverviewToAllAppsTouchController extends PortraitStatesTouchControl
}
@Override
- protected int getLogContainerTypeForNormalState() {
+ protected int getLogContainerTypeForNormalState(MotionEvent ev) {
return LauncherLogProto.ContainerType.WORKSPACE;
}
}
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
index 18b8af4fa..eb571f607 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
@@ -154,7 +154,7 @@ public class QuickSwitchTouchController extends AbstractStateChangeTouchControll
}
@Override
- protected int getLogContainerTypeForNormalState() {
+ protected int getLogContainerTypeForNormalState(MotionEvent ev) {
return LauncherLogProto.ContainerType.NAVBAR;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/LandscapeEdgeSwipeController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/LandscapeEdgeSwipeController.java
index 0605953dc..bb72315d3 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/LandscapeEdgeSwipeController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/LandscapeEdgeSwipeController.java
@@ -46,7 +46,7 @@ public class LandscapeEdgeSwipeController extends AbstractStateChangeTouchContro
}
@Override
- protected int getLogContainerTypeForNormalState() {
+ protected int getLogContainerTypeForNormalState(MotionEvent ev) {
return LauncherLogProto.ContainerType.NAVBAR;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java
index a55f36b78..b81edfa4c 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java
@@ -147,8 +147,8 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
}
@Override
- protected int getLogContainerTypeForNormalState() {
- return ContainerType.HOTSEAT;
+ protected int getLogContainerTypeForNormalState(MotionEvent ev) {
+ return isTouchOverHotseat(mLauncher, ev) ? ContainerType.HOTSEAT : ContainerType.WORKSPACE;
}
private AnimatorSetBuilder getNormalToOverviewAnimation() {
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index 054534417..c5ba5bab6 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -69,6 +69,7 @@ public abstract class AbstractStateChangeTouchController
protected final SwipeDetector.Direction mSwipeDirection;
private boolean mNoIntercept;
+ private boolean mIsLogContainerSet;
protected int mStartContainerType;
protected LauncherState mStartState;
@@ -180,7 +181,7 @@ public abstract class AbstractStateChangeTouchController
/**
* Returns the container that the touch started from when leaving NORMAL state.
*/
- protected abstract int getLogContainerTypeForNormalState();
+ protected abstract int getLogContainerTypeForNormalState(MotionEvent ev);
private boolean reinitCurrentAnimation(boolean reachedToState, boolean isDragTowardPositive) {
LauncherState newFromState = mFromState == null ? mLauncher.getStateManager().getState()
@@ -231,13 +232,7 @@ public abstract class AbstractStateChangeTouchController
@Override
public void onDragStart(boolean start) {
mStartState = mLauncher.getStateManager().getState();
- if (mStartState == ALL_APPS) {
- mStartContainerType = LauncherLogProto.ContainerType.ALLAPPS;
- } else if (mStartState == NORMAL) {
- mStartContainerType = getLogContainerTypeForNormalState();
- } else if (mStartState == OVERVIEW){
- mStartContainerType = LauncherLogProto.ContainerType.TASKSWITCHER;
- }
+ mIsLogContainerSet = false;
if (mCurrentAnimation == null) {
mFromState = mStartState;
mToState = null;
@@ -285,6 +280,21 @@ public abstract class AbstractStateChangeTouchController
return true;
}
+ @Override
+ public boolean onDrag(float displacement, MotionEvent ev) {
+ if (!mIsLogContainerSet) {
+ if (mStartState == ALL_APPS) {
+ mStartContainerType = LauncherLogProto.ContainerType.ALLAPPS;
+ } else if (mStartState == NORMAL) {
+ mStartContainerType = getLogContainerTypeForNormalState(ev);
+ } else if (mStartState == OVERVIEW) {
+ mStartContainerType = LauncherLogProto.ContainerType.TASKSWITCHER;
+ }
+ mIsLogContainerSet = true;
+ }
+ return onDrag(displacement);
+ }
+
protected void updateProgress(float fraction) {
mCurrentAnimation.setPlayFraction(fraction);
if (mAtomicComponentsController != null) {
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsSwipeController.java b/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsSwipeController.java
index e9dc800e3..bd6ea502e 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsSwipeController.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsSwipeController.java
@@ -57,7 +57,7 @@ public class AllAppsSwipeController extends AbstractStateChangeTouchController {
}
@Override
- protected int getLogContainerTypeForNormalState() {
+ protected int getLogContainerTypeForNormalState(MotionEvent ev) {
return mLauncher.getDragLayer().isEventOverView(mLauncher.getHotseat(), mTouchDownEvent) ?
ContainerType.HOTSEAT : ContainerType.WORKSPACE;
}