summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher2/LauncherModel.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
index ad75798f2..e0b04dacb 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -888,17 +888,28 @@ public class LauncherModel extends BroadcastReceiver {
private boolean checkItemPlacement(ItemInfo occupied[][][], ItemInfo item) {
int containerIndex = item.screen;
if (item.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
- // We use the last index to refer to the hotseat
- containerIndex = Launcher.SCREEN_COUNT;
// Return early if we detect that an item is under the hotseat button
if (Hotseat.isAllAppsButtonRank(item.screen)) {
return false;
}
+
+ // We use the last index to refer to the hotseat and the screen as the rank, so
+ // test and update the occupied state accordingly
+ if (occupied[Launcher.SCREEN_COUNT][item.screen][0] != null) {
+ Log.e(TAG, "Error loading shortcut into hotseat " + item
+ + " into position (" + item.screen + ":" + item.cellX + "," + item.cellY
+ + ") occupied by " + occupied[Launcher.SCREEN_COUNT][item.screen][0]);
+ return false;
+ } else {
+ occupied[Launcher.SCREEN_COUNT][item.screen][0] = item;
+ return true;
+ }
} else if (item.container != LauncherSettings.Favorites.CONTAINER_DESKTOP) {
// Skip further checking if it is not the hotseat or workspace container
return true;
}
+ // Check if any workspace icons overlap with each other
for (int x = item.cellX; x < (item.cellX+item.spanX); x++) {
for (int y = item.cellY; y < (item.cellY+item.spanY); y++) {
if (occupied[containerIndex][x][y] != null) {