From 88d70f2abc3f306f2f2d8ecbbf9610169462b7d9 Mon Sep 17 00:00:00 2001 From: Tony Date: Sat, 3 Mar 2018 05:36:23 -0800 Subject: [PATCH] Don't scroll to home card if overview isn't visible Consider these steps: - Swipe up for recents - Scroll over several cards - Swipe up for all apps - Press home Before this change, there was a delay as recents scrolled back to the workspace card before going home, even though it wasn't visible. Change-Id: I1c0edc8e02d1d1d236f47882695903e33e6b09ae --- .gitignore | 16 ---------------- .../uioverrides/RecentsViewStateController.java | 3 ++- 2 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 7240e4877b..0000000000 --- a/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -db_files -*.iml -.project -.classpath -.project.properties -gen/ -tests/stress/gen/ -WallpaperPicker/gen/ -WallpaperPicker/.project.properties -bin/ -.idea/ -.gradle/ -local.properties -gradle/ -build/ -gradlew* \ No newline at end of file diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java index 45424314be..92d071a08c 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java @@ -83,7 +83,8 @@ public class RecentsViewStateController implements StateHandler { // Scroll to the workspace card before changing to the NORMAL state. int currPage = mRecentsView.getCurrentPage(); - if (toState == NORMAL && currPage != 0 && !config.userControlled) { + LauncherState fromState = mLauncher.getStateManager().getState(); + if (fromState.overviewUi && toState == NORMAL && currPage != 0 && !config.userControlled) { int maxSnapDuration = PagedView.SLOW_PAGE_SNAP_ANIMATION_DURATION; int durationPerPage = maxSnapDuration / 10; int snapDuration = Math.min(maxSnapDuration, durationPerPage * currPage);