Fix issue with reseting touch handler

- Cleaning up/removing some extraneous code

Change-Id: I770383b7c3a4efb75e890dfb48196265636a2c44
This commit is contained in:
Winson Chung committed 2018-02-05 12:27:53 -08:00
1 parent 8b264568a1
commit 24bd85a848
2 files changed
+5 -16

No files matched your search

@@ -325,8 +325,7 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC
} else if (!isUsingScreenShot()) {
// Since we start touch tracking on DOWN, we may reach this state without actually
// starting the gesture. In that case, just cleanup immediately.
final BaseSwipeInteractionHandler handler = mInteractionHandler;
mMainThreadExecutor.execute(handler::reset);
reset();
}
mVelocityTracker.recycle();
mVelocityTracker = null;
@@ -106,7 +106,6 @@ public class WindowTransformSwipeHandler extends BaseSwipeInteractionHandler {
private final int mRunningTaskId;
private MultiStateCallback mStateCallback;
private boolean mControllerStateAnimation;
private AnimatorPlaybackController mLauncherTransitionController;
private Launcher mLauncher;
@@ -205,14 +204,13 @@ public class WindowTransformSwipeHandler extends BaseSwipeInteractionHandler {
mLauncher = launcher;
AbstractFloatingView.closeAllOpenViews(launcher, alreadyOnHome);
mControllerStateAnimation = alreadyOnHome;
mWasLauncherAlreadyVisible = alreadyOnHome;
mRecentsView = mLauncher.getOverviewPanel();
mLauncherLayoutListener = new LauncherLayoutListener(mLauncher);
final int state;
if (mControllerStateAnimation) {
if (mWasLauncherAlreadyVisible) {
DeviceProfile dp = mLauncher.getDeviceProfile();
long accuracy = 2 * Math.max(dp.widthPx, dp.heightPx);
mLauncherTransitionController = launcher.getStateManager()
@@ -240,15 +238,8 @@ public class WindowTransformSwipeHandler extends BaseSwipeInteractionHandler {
if (launcher != mLauncher) {
return;
}
mStateCallback.setState(STATE_LAUNCHER_DRAWN);
if ((mStateCallback.getState() & STATE_LAUNCHER_DRAWN) == 0) {
mStateCallback.setState(STATE_LAUNCHER_DRAWN);
rootView.animate().alpha(1)
.setDuration(getFadeInDuration())
.withEndAction(() -> mStateCallback.setState(launcher == mLauncher
? STATE_ACTIVITY_MULTIPLIER_COMPLETE : 0));
}
mStateCallback.setState(STATE_LAUNCHER_DRAWN);
}
});
state = STATE_LAUNCHER_READY;
@@ -338,7 +329,7 @@ public class WindowTransformSwipeHandler extends BaseSwipeInteractionHandler {
WindowManagerWrapper.getInstance().getStableInsets(mStableInsets);
initTransitionEndpoints(mLauncher.getDeviceProfile());
if (!mControllerStateAnimation) {
if (!mWasLauncherAlreadyVisible) {
AnimatorSet anim = new AnimatorSet();
if (mLauncher.getDeviceProfile().isVerticalBarLayout()) {
mLauncher.getAllAppsController().setProgress(1);
@@ -492,7 +483,7 @@ public class WindowTransformSwipeHandler extends BaseSwipeInteractionHandler {
}
public void layoutListenerClosed() {
if (mControllerStateAnimation) {
if (mWasLauncherAlreadyVisible) {
mLauncherTransitionController.setPlayFraction(1);
}
}
@@ -506,7 +497,6 @@ public class WindowTransformSwipeHandler extends BaseSwipeInteractionHandler {
if (mInteractionType == INTERACTION_QUICK_SWITCH) {
for (int i = mRecentsView.getFirstTaskIndex(); i < mRecentsView.getPageCount(); i++) {
TaskView taskView = (TaskView) mRecentsView.getPageAt(i);
// TODO: Match the keys directly
if (taskView.getTask().key.id != mRunningTaskId) {
mRecentsView.snapToPage(i, QUICK_SWITCH_SNAP_DURATION);
taskView.postDelayed(() -> {taskView.launchTask(true);},