summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlee worrall <lee@worrall.me.uk>2014-02-27 22:47:03 +0000
committerlee worrall <lee@worrall.me.uk>2014-03-03 09:20:19 +0000
commitd9bbfcbd622bf64d032a326fab43c47cb2f672cb (patch)
tree6e143f67e3eb2a4e0a5f54c1e39eced29344e58a
parent5d2516b82e097dca6e5dd63b5fe3501b09c88487 (diff)
downloadandroid_packages_apps_Trebuchet-d9bbfcbd622bf64d032a326fab43c47cb2f672cb.tar.gz
android_packages_apps_Trebuchet-d9bbfcbd622bf64d032a326fab43c47cb2f672cb.tar.bz2
android_packages_apps_Trebuchet-d9bbfcbd622bf64d032a326fab43c47cb2f672cb.zip
Trebuchet: fix icons disappearing from the hotseat (dock).
The "occupied" array for the hotseat should be [numHotseatIcons][1], not [numColumns+1][numRows+1], because numHotseatIcons can be >1 more than numColumns; so the rightmost hotseat icon is lost on restart if, for example, the workspace is 5x5 but there are 7 hotseat icons. Change-Id: If68b5fa3d668302601320cd0cb96498afe4fc200
-rw-r--r--src/com/android/launcher3/LauncherModel.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index d79e6279b..bc97e0af2 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -1308,8 +1308,6 @@ public class LauncherModel extends BroadcastReceiver {
AtomicBoolean deleteOnItemOverlap) {
LauncherAppState app = LauncherAppState.getInstance();
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
- int countX = (int) grid.numColumns;
- int countY = (int) grid.numRows;
long containerIndex = item.screenId;
if (item.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
@@ -1333,7 +1331,7 @@ public class LauncherModel extends BroadcastReceiver {
return true;
}
} else {
- ItemInfo[][] items = new ItemInfo[countX + 1][countY + 1];
+ ItemInfo[][] items = new ItemInfo[(int) grid.numHotseatIcons][1];
items[(int) item.screenId][0] = item;
occupied.put((long) LauncherSettings.Favorites.CONTAINER_HOTSEAT, items);
return true;
@@ -1343,6 +1341,9 @@ public class LauncherModel extends BroadcastReceiver {
return true;
}
+ int countX = (int) grid.numColumns;
+ int countY = (int) grid.numRows;
+
if (!occupied.containsKey(item.screenId)) {
ItemInfo[][] items = new ItemInfo[countX + 1][countY + 1];
occupied.put(item.screenId, items);