diff options
-rw-r--r-- | res/layout-sw720dp/launcher.xml | 6 | ||||
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 15 |
2 files changed, 10 insertions, 11 deletions
diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml index 156b8c33c..33fafeaa4 100644 --- a/res/layout-sw720dp/launcher.xml +++ b/res/layout-sw720dp/launcher.xml @@ -63,12 +63,6 @@ launcher:pageSpacing="@dimen/workspace_page_spacing" launcher:scrollIndicatorPaddingLeft="@dimen/workspace_divider_padding_left" launcher:scrollIndicatorPaddingRight="@dimen/workspace_divider_padding_right"> - - <include android:id="@+id/cell1" layout="@layout/workspace_screen" /> - <include android:id="@+id/cell2" layout="@layout/workspace_screen" /> - <include android:id="@+id/cell3" layout="@layout/workspace_screen" /> - <include android:id="@+id/cell4" layout="@layout/workspace_screen" /> - <include android:id="@+id/cell5" layout="@layout/workspace_screen" /> </com.android.launcher3.Workspace> <include layout="@layout/hotseat" diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 853e9ee85..cac3d66f2 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -457,10 +457,8 @@ public class Workspace extends SmoothPagedView cl.setClickable(true); cl.setContentDescription(getContext().getString( R.string.workspace_description_format, getChildCount())); - } - @Override - public void onChildViewRemoved(View parent, View child) { + super.onChildViewAdded(parent, child); } protected boolean shouldDrawChild(View child) { @@ -3635,6 +3633,7 @@ public class Workspace extends SmoothPagedView long screenId = getIdForScreen(cl); int container = Favorites.CONTAINER_DESKTOP; + Hotseat hotseat = mLauncher.getHotseat(); if (mLauncher.isHotseatLayout(cl)) { screenId = -1; container = Favorites.CONTAINER_HOTSEAT; @@ -3645,8 +3644,14 @@ public class Workspace extends SmoothPagedView ItemInfo info = (ItemInfo) v.getTag(); // Null check required as the AllApps button doesn't have an item info if (info != null) { - LauncherModel.addItemToDatabase(mLauncher, info, container, screenId, info.cellX, - info.cellY, false); + int cellX = info.cellX; + int cellY = info.cellY; + if (container == Favorites.CONTAINER_HOTSEAT) { + cellX = hotseat.getCellXFromOrder((int) info.screenId); + cellY = hotseat.getCellYFromOrder((int) info.screenId); + } + LauncherModel.addItemToDatabase(mLauncher, info, container, screenId, cellX, + cellY, false); } if (v instanceof FolderIcon) { FolderIcon fi = (FolderIcon) v; |