summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-10-04 20:58:25 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-04 20:58:25 +0000
commit8cffccc15f0dc389ba556093de80be6bade06213 (patch)
tree48f24aeb12d439a660e3a447d3520398044e814a
parent2fe1530ce9ab8c8a48aed7df62c771e774df23a7 (diff)
parent8741298d3c6a17015dabc4aacc261fd8eb59992d (diff)
downloadandroid_packages_apps_Trebuchet-8cffccc15f0dc389ba556093de80be6bade06213.tar.gz
android_packages_apps_Trebuchet-8cffccc15f0dc389ba556093de80be6bade06213.tar.bz2
android_packages_apps_Trebuchet-8cffccc15f0dc389ba556093de80be6bade06213.zip
Merge "Fixing issue with numerous empty screens showing when adding a shortcut to a clear workspace. (Bug 10785413)" into jb-ub-now-indigo-rose
-rw-r--r--src/com/android/launcher3/Launcher.java3
-rw-r--r--src/com/android/launcher3/LauncherModel.java6
2 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index f3a02b3c2..e3e065e03 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3664,6 +3664,9 @@ public class Launcher extends Activity
addAnimated.size(), true);
}
+ // Remove the extra empty screen
+ mWorkspace.removeExtraEmptyScreen();
+
if (!AppsCustomizePagedView.DISABLE_ALL_APPS &&
addedApps != null && mAppsCustomizeContent != null) {
mAppsCustomizeContent.addApps(addedApps);
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index edfc07059..d1819e14d 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -318,8 +318,10 @@ public class LauncherModel extends BroadcastReceiver {
continue;
}
- // Add this icon to the db, creating a new page if necessary
- int startSearchPageIndex = 1;
+ // Add this icon to the db, creating a new page if necessary. If there
+ // is only the empty page then we just add items to the first page.
+ // Otherwise, we add them to the next pages.
+ int startSearchPageIndex = workspaceScreens.isEmpty() ? 0 : 1;
Pair<Long, int[]> coords = LauncherModel.findNextAvailableIconSpace(context,
name, launchIntent, startSearchPageIndex, workspaceScreens);
if (coords == null) {