Merge "Fix quickswitch flickers/ignored swipes" into ub-launcher3-qt-future-dev

This commit is contained in:
Tony Wickham
2019-10-07 21:08:34 +00:00
committed by Android (Google) Code Review
3 changed files with 20 additions and 8 deletions
@@ -922,7 +922,15 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
windowAnim.addListener(new AnimationSuccessListener() {
@Override
public void onAnimationSuccess(Animator animator) {
setStateOnUiThread(target.endState);
if (target == NEW_TASK && mRecentsView != null
&& mRecentsView.getNextPage() == mRecentsView.getRunningTaskIndex()) {
// We are about to launch the current running task, so use LAST_TASK state
// instead of NEW_TASK. This could happen, for example, if our scroll is
// aborted after we determined the target to be NEW_TASK.
setStateOnUiThread(LAST_TASK.endState);
} else {
setStateOnUiThread(target.endState);
}
}
});
windowAnim.start();
@@ -17,7 +17,6 @@
package com.android.quickstep.views;
import static androidx.dynamicanimation.animation.DynamicAnimation.MIN_VISIBLE_CHANGE_PIXELS;
import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS;
import static com.android.launcher3.InvariantDeviceProfile.CHANGE_FLAG_ICON_PARAMS;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
@@ -573,11 +572,14 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
taskView.bind(task);
}
TaskView runningTaskView = getRunningTaskView();
if (runningTaskView != null) {
setCurrentPage(indexOfChild(runningTaskView));
} else if (getTaskViewCount() > 0) {
setCurrentPage(indexOfChild(getTaskViewAt(0)));
if (mNextPage == INVALID_PAGE) {
// Set the current page to the running task, but not if settling on new task.
TaskView runningTaskView = getRunningTaskView();
if (runningTaskView != null) {
setCurrentPage(indexOfChild(runningTaskView));
} else if (getTaskViewCount() > 0) {
setCurrentPage(indexOfChild(getTaskViewAt(0)));
}
}
if (mIgnoreResetTaskId != -1 && getTaskView(mIgnoreResetTaskId) != ignoreResetTaskView) {
+3 -1
View File
@@ -1088,7 +1088,9 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
if (mFreeScroll) {
setCurrentPage(getNextPage());
} else if (wasFreeScroll) {
snapToPage(getNextPage());
if (getScrollForPage(getNextPage()) != getScrollX()) {
snapToPage(getNextPage());
}
}
}