summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2013-11-27 00:00:28 +0000
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-11-27 00:00:28 +0000
commitf7621a4f9ec7216ea8ad135ac136edabf7cebb3d (patch)
treeeebf85e1cf22d21dff6e70ee4f5458de45d11db5
parente7d24f829373191b88d8b5547129c983b7b877c8 (diff)
parentd13e36ca1288bd46b5871901dc9f2d1a00b6b282 (diff)
downloadandroid_packages_apps_Trebuchet-f7621a4f9ec7216ea8ad135ac136edabf7cebb3d.zip
android_packages_apps_Trebuchet-f7621a4f9ec7216ea8ad135ac136edabf7cebb3d.tar.gz
android_packages_apps_Trebuchet-f7621a4f9ec7216ea8ad135ac136edabf7cebb3d.tar.bz2
Merge "Trebuchet : Ensure defaultWorkspace cleanup" into cm-10.2
-rw-r--r--src/com/cyanogenmod/trebuchet/LauncherProvider.java38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/com/cyanogenmod/trebuchet/LauncherProvider.java b/src/com/cyanogenmod/trebuchet/LauncherProvider.java
index d7b17d2..b1474c8 100644
--- a/src/com/cyanogenmod/trebuchet/LauncherProvider.java
+++ b/src/com/cyanogenmod/trebuchet/LauncherProvider.java
@@ -654,20 +654,11 @@ public class LauncherProvider extends ContentProvider {
ItemInfo info = new ItemInfo();
info.container = container;
- info.cellX = values.getAsInteger(LauncherSettings.Favorites.CELLX);
- info.cellY = values.getAsInteger(LauncherSettings.Favorites.CELLY);
- info.screen = values.getAsInteger(LauncherSettings.Favorites.SCREEN);
-
- if (values.containsKey(LauncherSettings.Favorites.SPANX)) {
- info.spanX = values.getAsInteger(LauncherSettings.Favorites.SPANX);
- } else {
- info.spanX = 1;
- }
- if (values.containsKey(LauncherSettings.Favorites.SPANY)) {
- info.spanY = values.getAsInteger(LauncherSettings.Favorites.SPANY);
- } else {
- info.spanY = 1;
- }
+ info.spanX = a.getInt(R.styleable.Favorite_spanX, 1);
+ info.spanY = a.getInt(R.styleable.Favorite_spanY, 1);
+ info.cellX = a.getInt(R.styleable.Favorite_x, 0);
+ info.cellY = a.getInt(R.styleable.Favorite_y, 0);
+ info.screen = a.getInt(R.styleable.Favorite_screen, 0);
if (!app.getModel().checkItemPlacement(occupied, info)) {
continue;
@@ -747,7 +738,24 @@ public class LauncherProvider extends ContentProvider {
added = false;
}
}
- if (added) i++;
+ if (added) {
+ i++;
+ } else {
+ int containerIndex = -1;
+ if (info.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
+ containerIndex = info.screen + Launcher.MAX_WORKSPACE_SCREEN_COUNT;
+ } else if (info.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
+ containerIndex = info.screen;
+ }
+
+ if (containerIndex != -1) {
+ for (int gridX = info.cellX; gridX < (info.cellX+info.spanX); gridX++) {
+ for (int gridY = info.cellY; gridY < (info.cellY+info.spanY); gridY++) {
+ occupied[containerIndex][gridX][gridY] = null;
+ }
+ }
+ }
+ }
a.recycle();
}
} catch (XmlPullParserException e) {