Merge "Correctly recenter the wallpaper when going back to default screen."
diff --git a/res/layout-land/workspace_screen.xml b/res/layout-land/workspace_screen.xml
index 2483f51..a58ea07 100644
--- a/res/layout-land/workspace_screen.xml
+++ b/res/layout-land/workspace_screen.xml
@@ -20,6 +20,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:hapticFeedbackEnabled="false"
launcher:cellWidth="@dimen/workspace_cell_width"
launcher:cellHeight="@dimen/workspace_cell_height"
diff --git a/res/layout-port/workspace_screen.xml b/res/layout-port/workspace_screen.xml
index b43375b..4929c2f 100644
--- a/res/layout-port/workspace_screen.xml
+++ b/res/layout-port/workspace_screen.xml
@@ -20,6 +20,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:hapticFeedbackEnabled="false"
launcher:cellWidth="@dimen/workspace_cell_width"
launcher:cellHeight="@dimen/workspace_cell_height"
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index 321874b..d3503de 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -160,9 +160,14 @@
mRS = createRenderScript(true);
}
+ /**
+ * Note that this implementation prohibits this view from ever being reattached.
+ */
@Override
protected void onDetachedFromWindow() {
destroyRenderScript();
+ mRS.mMessageCallback = null;
+ mRS = null;
}
/**
@@ -217,7 +222,9 @@
mRollo.dirtyCheck();
mRollo.resize(w, h);
- mRS.mMessageCallback = mMessageProc = new AAMessage();
+ if (mRS != null) {
+ mRS.mMessageCallback = mMessageProc = new AAMessage();
+ }
Resources res = getContext().getResources();
int barHeight = (int)res.getDimension(R.dimen.button_bar_height);
@@ -683,6 +690,11 @@
}
public void setApps(ArrayList<ApplicationInfo> list) {
+ if (mRS == null) {
+ // We've been removed from the window. Don't bother with all this.
+ return;
+ }
+
mAllAppsList = list;
if (mRollo != null) {
mRollo.setApps(list);
@@ -695,6 +707,10 @@
// Not done loading yet. We'll find out about it later.
return;
}
+ if (mRS == null) {
+ // We've been removed from the window. Don't bother with all this.
+ return;
+ }
final int N = list.size();
if (mRollo != null) {
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 089e551..ee92fc7 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -558,6 +558,7 @@
mWorkspace = (Workspace) dragLayer.findViewById(R.id.workspace);
final Workspace workspace = mWorkspace;
+ workspace.setHapticFeedbackEnabled(false);
DeleteZone deleteZone = (DeleteZone) dragLayer.findViewById(R.id.delete_zone);
mDeleteZone = deleteZone;
@@ -1385,6 +1386,8 @@
if (cellInfo.valid) {
// User long pressed on empty space
mWorkspace.setAllowLongPress(false);
+ mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+ HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
showAddDialog(cellInfo);
}
} else {