Accumulating tab presses during animations
Also introducing these animations. Will need to talk to UX regarding
these animations' properties. So far, I'm keeping a growing list of
questions to UX.
Bug: 73090995
Test: Press, Alt-tab, tab with and without shift, press Alt-Tab on
already open Overview.
Change-Id: Ib7250349acc528d14d8702f60b0f205612205478
diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
index b1afff5..efca9eb 100644
--- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
+++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
@@ -93,7 +93,7 @@
public void onOverviewShown() {
if (isOverviewAlmostVisible()) {
final RecentsView rv = getLauncher().getOverviewPanel();
- rv.selectNextTask();
+ rv.snapToTaskAfterNext();
} else {
openRecents();
}
@@ -101,7 +101,7 @@
public void onOverviewHidden() {
final RecentsView rv = getLauncher().getOverviewPanel();
- rv.launchCurrentTask();
+ rv.launchNextTask();
}
private void startNonLauncherTask(int backStackCount) {
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index f6eed58..9c0e580 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -613,7 +613,7 @@
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getKeyCode() == KeyEvent.KEYCODE_TAB
&& event.getAction() == KeyEvent.ACTION_DOWN) {
- setCurrentPage((getCurrentPage()
+ snapToPage((getNextPage()
+ (event.isShiftPressed() ? getPageCount() - 1 : 1)) % getPageCount());
loadVisibleTaskData();
return true;
@@ -621,13 +621,13 @@
return super.dispatchKeyEvent(event);
}
- public void selectNextTask() {
- setCurrentPage((getCurrentPage() + 1) % getPageCount());
+ public void snapToTaskAfterNext() {
+ snapToPage((getNextPage() + 1) % getPageCount());
loadVisibleTaskData();
}
- public void launchCurrentTask() {
- final TaskView currentTask = (TaskView) getChildAt(getCurrentPage());
- currentTask.launchTask(true);
+ public void launchNextTask() {
+ final TaskView nextTask = (TaskView) getChildAt(getNextPage());
+ nextTask.launchTask(true);
}
}