Merge "Changing press feedback to holographic for search buttons. (Bug: 5290367)" into ics-mr0
diff --git a/src/com/android/launcher2/Hotseat.java b/src/com/android/launcher2/Hotseat.java
index 85412c6..f1fb6ab 100644
--- a/src/com/android/launcher2/Hotseat.java
+++ b/src/com/android/launcher2/Hotseat.java
@@ -107,7 +107,7 @@
@Override
public void onClick(android.view.View v) {
if (mLauncher != null) {
- mLauncher.showAllApps(true);
+ mLauncher.onClickAllAppsButton(v);
}
}
});
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 5eaf773..6d95555 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -244,6 +244,12 @@
private BubbleTextView mWaitingForResume;
+ private Runnable mBuildLayersRunnable = new Runnable() {
+ public void run() {
+ mWorkspace.buildPageHardwareLayers();
+ }
+ };
+
private static ArrayList<PendingAddArguments> sPendingAddList
= new ArrayList<PendingAddArguments>();
@@ -550,6 +556,9 @@
// When we resume Launcher, a different Activity might be responsible for the app
// market intent, so refresh the icon
updateAppMarketIcon();
+ if (!mWorkspaceLoading) {
+ mWorkspace.post(mBuildLayersRunnable);
+ }
}
@Override
@@ -1679,7 +1688,7 @@
if (mState == State.APPS_CUSTOMIZE) {
showWorkspace(true);
} else {
- showAllApps(true);
+ onClickAllAppsButton(v);
}
}
}
@@ -1722,6 +1731,8 @@
* @param v The view that was clicked.
*/
public void onClickAllAppsButton(View v) {
+ // Provide the same haptic feedback that the system offers for virtual keys.
+ v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
showAllApps(true);
}
@@ -2964,6 +2975,8 @@
// Update the market app icon as necessary (the other icons will be managed in response to
// package changes in bindSearchablesChanged()
updateAppMarketIcon();
+
+ mWorkspace.post(mBuildLayersRunnable);
}
@Override
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 9c25afc..8a492a2 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -313,6 +313,16 @@
setMotionEventSplittingEnabled(true);
}
+ public void buildPageHardwareLayers() {
+ if (getWindowToken() != null) {
+ final int childCount = getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ CellLayout cl = (CellLayout) getChildAt(i);
+ cl.buildChildrenLayer();
+ }
+ }
+ }
+
public void onDragStart(DragSource source, Object info, int dragAction) {
mIsDragOccuring = true;
updateChildrenLayersEnabled();