Merge "Implement swipe up and quick scrub onboarding (Pt. Launcher)" into ub-launcher3-edmonton

This commit is contained in:
TreeHugger Robot
2018-04-19 00:45:09 +00:00
committed by Android (Google) Code Review
5 changed files with 24 additions and 0 deletions
Binary file not shown.
@@ -12,6 +12,7 @@ import com.android.launcher3.LauncherState;
import com.android.launcher3.touch.AbstractStateChangeTouchController;
import com.android.launcher3.touch.SwipeDetector;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.util.SysuiEventLogger;
/**
@@ -19,6 +20,8 @@ import com.android.quickstep.util.SysuiEventLogger;
*/
public class LandscapeEdgeSwipeController extends AbstractStateChangeTouchController {
private static final String TAG = "LandscapeEdgeSwipeCtrl";
public LandscapeEdgeSwipeController(Launcher l) {
super(l, SwipeDetector.HORIZONTAL);
}
@@ -69,6 +72,7 @@ public class LandscapeEdgeSwipeController extends AbstractStateChangeTouchContro
protected void onSwipeInteractionCompleted(LauncherState targetState, int logAction) {
super.onSwipeInteractionCompleted(targetState, logAction);
if (mFromState == NORMAL && targetState == OVERVIEW) {
RecentsModel.getInstance(mLauncher).onOverviewShown(true, TAG);
SysuiEventLogger.writeDummyRecentsTransition(0);
}
}
@@ -39,6 +39,7 @@ import com.android.launcher3.touch.AbstractStateChangeTouchController;
import com.android.launcher3.touch.SwipeDetector;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.TouchInteractionService;
import com.android.quickstep.util.SysuiEventLogger;
import com.android.quickstep.views.RecentsView;
@@ -49,6 +50,8 @@ import com.android.quickstep.views.TaskView;
*/
public class PortraitStatesTouchController extends AbstractStateChangeTouchController {
private static final String TAG = "PortraitStatesTouchCtrl";
private static final float TOTAL_DISTANCE_MULTIPLIER = 3f;
private static final float LINEAR_SCALE_LIMIT = 1 / TOTAL_DISTANCE_MULTIPLIER;
@@ -284,6 +287,7 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
protected void onSwipeInteractionCompleted(LauncherState targetState, int logAction) {
super.onSwipeInteractionCompleted(targetState, logAction);
if (mFromState == NORMAL && targetState == OVERVIEW) {
RecentsModel.getInstance(mLauncher).onOverviewShown(true, TAG);
SysuiEventLogger.writeDummyRecentsTransition(0);
}
}
@@ -26,8 +26,10 @@ import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
import android.os.RemoteException;
import android.os.UserHandle;
import android.support.annotation.WorkerThread;
import android.util.Log;
import android.util.LruCache;
import android.util.SparseArray;
import android.view.accessibility.AccessibilityManager;
@@ -234,6 +236,19 @@ public class RecentsModel extends TaskStackChangeListener {
mRecentsTaskLoader.onTrimMemory(level);
}
public void onOverviewShown(boolean fromHome, String tag) {
if (mSystemUiProxy == null) {
return;
}
try {
mSystemUiProxy.onOverviewShown(fromHome);
} catch (RemoteException e) {
Log.w(tag,
"Failed to notify SysUI of overview shown from " + (fromHome ? "home" : "app")
+ ": ", e);
}
}
@WorkerThread
public void preloadAssistData(int taskId, Bundle data) {
mMainThreadExecutor.execute(() -> {
@@ -698,6 +698,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
// If we haven't posted the transition end runnable, run it now
finishTransitionRunnable.run();
}
RecentsModel.getInstance(mContext).onOverviewShown(false, TAG);
doLogGesture(true /* toLauncher */);
}