summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3
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 /src/com/android/launcher3
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
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r--src/com/android/launcher3/touch/AbstractStateChangeTouchController.java26
1 files changed, 18 insertions, 8 deletions
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) {