summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-06-25 16:19:53 -0700
committerWinson Chung <winsonc@google.com>2013-06-25 18:47:44 -0700
commitf70696d8cc9b68c1491496de952349866dd6f6ed (patch)
treeb83dff6ae385507b5b72c411666755a30075e974
parent5ccb418b0913a5ac6d0c5d601c01b1b01b0e7f3c (diff)
downloadandroid_packages_apps_Trebuchet-f70696d8cc9b68c1491496de952349866dd6f6ed.zip
android_packages_apps_Trebuchet-f70696d8cc9b68c1491496de952349866dd6f6ed.tar.gz
android_packages_apps_Trebuchet-f70696d8cc9b68c1491496de952349866dd6f6ed.tar.bz2
Fixing crash in shrink wrap on tablets.
Change-Id: I061960b2ca7a2cf02729665fb032d23d8f463ada
-rw-r--r--res/layout-sw720dp/launcher.xml6
-rw-r--r--src/com/android/launcher3/Workspace.java15
2 files changed, 10 insertions, 11 deletions
diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml
index 156b8c3..33fafea 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 853e9ee..cac3d66 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;