Merge "Don't scroll to home card if overview isn't visible" into ub-launcher3-master
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 7240e48..0000000
--- 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 4542431..92d071a 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
@@ -83,7 +83,8 @@
// 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);