Merge branch 'master' into honeycomb-release
diff --git a/res/drawable-xlarge/all_apps_button_normal.9.png b/res/drawable-xlarge/all_apps_button_normal.9.png
new file mode 100644
index 0000000..a423145
--- /dev/null
+++ b/res/drawable-xlarge/all_apps_button_normal.9.png
Binary files differ
diff --git a/res/drawable-xlarge/all_apps_button_normal.png b/res/drawable-xlarge/all_apps_button_normal.png
deleted file mode 100644
index e1c8b7d..0000000
--- a/res/drawable-xlarge/all_apps_button_normal.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge/all_apps_button_pressed.9.png b/res/drawable-xlarge/all_apps_button_pressed.9.png
new file mode 100644
index 0000000..5dbe77c
--- /dev/null
+++ b/res/drawable-xlarge/all_apps_button_pressed.9.png
Binary files differ
diff --git a/res/drawable-xlarge/all_apps_button_pressed.png b/res/drawable-xlarge/all_apps_button_pressed.png
deleted file mode 100644
index 9dcfaa5..0000000
--- a/res/drawable-xlarge/all_apps_button_pressed.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge/configure_button_normal.png b/res/drawable-xlarge/configure_button_normal.png
index b11c2a8..9b37eff 100644
--- a/res/drawable-xlarge/configure_button_normal.png
+++ b/res/drawable-xlarge/configure_button_normal.png
Binary files differ
diff --git a/res/drawable-xlarge/configure_button_pressed.png b/res/drawable-xlarge/configure_button_pressed.png
index 70db9b7..5f38db6 100644
--- a/res/drawable-xlarge/configure_button_pressed.png
+++ b/res/drawable-xlarge/configure_button_pressed.png
Binary files differ
diff --git a/res/drawable-xlarge/search_button.xml b/res/drawable-xlarge/search_button_generic.xml
similarity index 100%
rename from res/drawable-xlarge/search_button.xml
rename to res/drawable-xlarge/search_button_generic.xml
diff --git a/res/layout-xlarge/launcher.xml b/res/layout-xlarge/launcher.xml
index 9ed2dc5..2b43442 100644
--- a/res/layout-xlarge/launcher.xml
+++ b/res/layout-xlarge/launcher.xml
@@ -54,7 +54,6 @@
 
         <ImageView
             android:id="@+id/search_button"
-            android:src="@drawable/search_button"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
             android:layout_gravity="left"
@@ -65,14 +64,29 @@
             android:clickable="true"/>
 
         <ImageView
-            android:id="@+id/all_apps_button"
-            android:src="@drawable/all_apps_button"
+            android:id="@+id/configure_button"
+            android:src="@drawable/configure_button"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
             android:layout_alignParentRight="true"
             android:layout_marginLeft="@dimen/toolbar_button_spacing"
             android:layout_marginRight="@dimen/toolbar_button_spacing"
 
+            android:onClick="onClickConfigureButton"
+            android:focusable="true"
+            android:clickable="true" />
+
+        <TextView
+            android:id="@+id/all_apps_button"
+            android:text="@string/all_apps_button_label"
+            android:background="@drawable/all_apps_button"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_toLeftOf="@id/configure_button"
+            android:layout_marginLeft="@dimen/toolbar_button_spacing"
+            android:layout_marginRight="@dimen/toolbar_button_spacing"
+            android:textSize="18dip"
+
             android:onClick="onClickAllAppsButton"
             android:focusable="true"
             android:clickable="true" />
@@ -90,18 +104,6 @@
             android:clickable="false"
             android:visibility="gone"/>
 
-        <ImageView
-            android:id="@+id/configure_button"
-            android:src="@drawable/configure_button"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_toLeftOf="@id/all_apps_button"
-            android:layout_marginLeft="@dimen/toolbar_button_spacing"
-
-            android:onClick="onClickConfigureButton"
-            android:focusable="true"
-            android:clickable="true" />
-
         <com.android.launcher2.DeleteZone
             android:id="@+id/delete_zone"
             android:src="@drawable/delete_zone_selector"
diff --git a/res/values-xlarge/styles.xml b/res/values-xlarge/styles.xml
index 637b6ce..59301b9 100644
--- a/res/values-xlarge/styles.xml
+++ b/res/values-xlarge/styles.xml
@@ -18,9 +18,13 @@
 -->
 
 <resources>
-    <style name="Theme" parent="Theme.Base">
+    <style name="Theme" parent="android:Theme.Holo">
         <item name="android:windowNoTitle">true</item>
         <item name="android:windowActionModeOverlay">true</item>
+
+        <item name="android:windowBackground">@android:color/transparent</item>
+        <item name="android:colorBackgroundCacheHint">@null</item>
+        <item name="android:windowShowWallpaper">true</item>
     </style>
 
     <style name="WorkspaceIcon.Portrait">
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 98de9db..59fdfd3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -118,8 +118,8 @@
     <!-- Title of dialog when user is selecting live folder to add to homescreen -->
     <string name="title_select_live_folder">Select folder</string>
 
-    <!-- All applications label for accessibilty (spoken when the button gets focus). -->
-    <string name="all_apps_button_label">All applications</string>
+    <!-- All applications label -->
+    <string name="all_apps_button_label">Apps</string>
     <!-- Label for button in all applications label to go back home (to the workspace / desktop)
          for accessibilty (spoken when the button gets focus). -->
     <string name="all_apps_home_button_label">Home</string>
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 7eb0256..ad37779 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -239,6 +239,7 @@
     private CharSequence[] mHotseatLabels = null;
 
     private Intent mAppMarketIntent = null;
+    private Intent mGlobalSearchIntent = null;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -1756,11 +1757,13 @@
      * @param v The view that was clicked.
      */
     public void onClickSearchButton(View v) {
-        Intent i = new Intent(SearchManager.INTENT_ACTION_GLOBAL_SEARCH);
-        View button = findViewById(R.id.search_button);
-        i.setSourceBounds(
-                new Rect(button.getLeft(), button.getTop(), button.getRight(), button.getBottom()));
-        startActivity(i);
+        if (mGlobalSearchIntent != null) {
+            View b = findViewById(R.id.search_button);
+            mGlobalSearchIntent.setSourceBounds(
+                    new Rect(b.getLeft(), b.getTop(), b.getRight(), b.getBottom()));
+            startActivitySafely(mGlobalSearchIntent, "global search");
+        }
+
     }
 
     /**
@@ -2670,19 +2673,17 @@
         }
     }
 
-    /**
-     * Sets the app market icon (shown when all apps is visible on x-large screens)
-     */
-    private void updateAppMarketIcon() {
+    /* Core logic for updating market and search button icons. Intent is used to resolve which
+     * activity to ask for an icon. Returns intent to launch the activity, or null if it wasn't
+     * resolved */
+    private Intent updateExternalIcon(int buttonId, Intent intent, int fallbackDrawableId) {
         if (LauncherApplication.isScreenXLarge()) {
             // Find the app market activity by resolving an intent.
             // (If multiple app markets are installed, it will return the ResolverActivity.)
             PackageManager packageManager = getPackageManager();
-            Intent intent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_APP_MARKET);
             ComponentName activityName = intent.resolveActivity(getPackageManager());
             if (activityName != null) {
-                mAppMarketIntent = intent;
-                ImageView marketButton = (ImageView) findViewById(R.id.market_button);
+                ImageView button = (ImageView) findViewById(buttonId);
                 Drawable toolbarIcon = null;
                 try {
                     // Look for the toolbar icon specified in the activity meta-data
@@ -2700,14 +2701,28 @@
                 }
                 // If we were unable to find the icon via the meta-data, use a generic one
                 if (toolbarIcon == null) {
-                    marketButton.setImageResource(R.drawable.app_market_generic);
+                    button.setImageResource(fallbackDrawableId);
                 } else {
-                    marketButton.setImageDrawable(toolbarIcon);
+                    button.setImageDrawable(toolbarIcon);
                 }
-            } else {
-                mAppMarketIntent = null;
+                return intent;
             }
         }
+        return null;
+    }
+    /**
+     * Sets the app market icon (shown when all apps is visible on x-large screens)
+     */
+    private void updateAppMarketIcon() {
+        Intent intent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_APP_MARKET);
+        mAppMarketIntent = updateExternalIcon(
+                R.id.market_button, intent, R.drawable.app_market_generic);
+    }
+
+    private void updateGlobalSearchIcon() {
+        Intent intent = new Intent(SearchManager.INTENT_ACTION_GLOBAL_SEARCH);
+        mGlobalSearchIntent = updateExternalIcon(
+                R.id.search_button, intent, R.drawable.search_button_generic);
     }
 
     /**
@@ -3018,6 +3033,7 @@
             mCustomizePagedView.setApps(apps);
         }
         updateAppMarketIcon();
+        updateGlobalSearchIcon();
     }
 
     /**
@@ -3032,6 +3048,7 @@
             mCustomizePagedView.addApps(apps);
         }
         updateAppMarketIcon();
+        updateGlobalSearchIcon();
     }
 
     /**
@@ -3047,6 +3064,7 @@
             mCustomizePagedView.updateApps(apps);
         }
         updateAppMarketIcon();
+        updateGlobalSearchIcon();
     }
 
     /**
@@ -3064,6 +3082,7 @@
             mCustomizePagedView.removeApps(apps);
         }
         updateAppMarketIcon();
+        updateGlobalSearchIcon();
     }
 
     /**