Merge "Clean up unused code and import declarations" into ics-mr1
diff --git a/res/drawable/button_bg.xml b/res/drawable/button_bg.xml
index a830594..e7b1bcd 100644
--- a/res/drawable/button_bg.xml
+++ b/res/drawable/button_bg.xml
@@ -15,7 +15,7 @@
 -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_focused="true" android:drawable="@drawable/focused_bg" />
-    <item android:state_pressed="true" android:drawable="@drawable/home_press" />
+    <item android:state_focused="true" android:drawable="@drawable/tab_unselected_focused_holo" />
+    <item android:state_pressed="true" android:drawable="@drawable/tab_unselected_focused_holo" />
     <item android:drawable="@android:color/transparent" />
 </selector>
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
index a74eb14..c11c788 100644
--- a/res/layout-land/launcher.xml
+++ b/res/layout-land/launcher.xml
@@ -22,29 +22,6 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-    <!-- Keep these behind the workspace so that they are not visible when
-         we go into AllApps -->
-    <include
-        android:id="@+id/qsb_divider"
-        layout="@layout/workspace_divider"
-        android:layout_width="wrap_content"
-        android:layout_height="match_parent"
-        android:layout_marginLeft="@dimen/qsb_bar_height"
-        android:layout_gravity="left" />
-    <include
-        android:id="@+id/dock_divider"
-        layout="@layout/workspace_divider"
-        android:layout_width="wrap_content"
-        android:layout_height="match_parent"
-        android:layout_marginRight="@dimen/button_bar_height"
-        android:layout_gravity="right" />
-    <include
-        android:id="@+id/paged_view_indicator"
-        layout="@layout/scroll_indicator"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="bottom" />
-
     <!-- The workspace contains 5 screens of cells -->
     <com.android.launcher2.Workspace
         android:id="@+id/workspace"
@@ -66,6 +43,27 @@
         <include android:id="@+id/cell5" layout="@layout/workspace_screen" />
     </com.android.launcher2.Workspace>
 
+    <include
+        android:id="@+id/qsb_divider"
+        layout="@layout/workspace_divider"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_marginLeft="@dimen/qsb_bar_height"
+        android:layout_gravity="left" />
+    <include
+        android:id="@+id/dock_divider"
+        layout="@layout/workspace_divider"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_marginRight="@dimen/button_bar_height"
+        android:layout_gravity="right" />
+    <include
+        android:id="@+id/paged_view_indicator"
+        layout="@layout/scroll_indicator"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="bottom" />
+
     <include layout="@layout/hotseat"
         android:id="@+id/hotseat"
         android:layout_width="@dimen/button_bar_height_plus_padding"
diff --git a/res/layout/market_button.xml b/res/layout/market_button.xml
index 5e10156..27eb3fd 100644
--- a/res/layout/market_button.xml
+++ b/res/layout/market_button.xml
@@ -21,6 +21,7 @@
     android:gravity="center"
     android:paddingLeft="16dp"
     android:paddingRight="16dp"
+    android:background="@drawable/tab_widget_indicator_selector"
     android:contentDescription="@string/market"
     android:shadowColor="@color/workspace_all_apps_and_delete_zone_text_shadow_color"
     android:shadowDx="0.0"
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index 89e6773..6d0261f 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -31,7 +31,9 @@
          really only in spring loaded mode... -->
     <dimen name="workspace_top_padding">0dp</dimen>
     <dimen name="workspace_bottom_padding">0dp</dimen>
-    <dimen name="workspace_page_spacing">-1dp</dimen>
+    <!-- We really want the page spacing to be the max of either the button bar
+         height or the qsb bar height -->
+    <dimen name="workspace_page_spacing">@dimen/button_bar_height</dimen>
     <dimen name="workspace_divider_padding_left">0dp</dimen>
     <dimen name="workspace_divider_padding_right">0dp</dimen>
     <dimen name="workspace_divider_padding_top">12dp</dimen>
diff --git a/res/values-land/styles.xml b/res/values-land/styles.xml
index 7949d2d..71ab658 100644
--- a/res/values-land/styles.xml
+++ b/res/values-land/styles.xml
@@ -23,6 +23,7 @@
         <item name="android:layout_width">wrap_content</item>
         <item name="android:layout_height">wrap_content</item>
     </style>
+
 <!-- Search Bar -->
     <style name="QSBBar">
         <item name="android:orientation">vertical</item>
@@ -65,5 +66,10 @@
         <item name="android:shadowDy">1.0</item>
         <item name="android:shadowRadius">4.0</item>
     </style>
+
+<!-- AppsCustomize -->
+    <style name="TabIndicator.AppsCustomize">
+        <item name="android:maxWidth">200dp</item>
+    </style>
 </resources>
 
diff --git a/res/values-port/styles.xml b/res/values-port/styles.xml
index d631d1e..20369c9 100644
--- a/res/values-port/styles.xml
+++ b/res/values-port/styles.xml
@@ -29,4 +29,9 @@
         <item name="android:layout_width">wrap_content</item>
         <item name="android:layout_height">wrap_content</item>
     </style>
+
+<!-- AppsCustomize -->
+    <style name="TabIndicator.AppsCustomize">
+        <item name="android:maxWidth">130dp</item>
+    </style>
 </resources>
diff --git a/res/values-sw340dp-port/styles.xml b/res/values-sw340dp-port/styles.xml
index 9a42249..b309d85 100644
--- a/res/values-sw340dp-port/styles.xml
+++ b/res/values-sw340dp-port/styles.xml
@@ -26,6 +26,9 @@
     </style>
 
 <!-- AppsCustomize -->
+    <style name="TabIndicator.AppsCustomize">
+        <item name="android:maxWidth">150dp</item>
+    </style>
     <style name="WorkspaceIcon.Portrait.AppsCustomize">
         <item name="android:singleLine">false</item>
         <item name="android:maxLines">2</item>
diff --git a/res/values-sw600dp-port/styles.xml b/res/values-sw600dp-port/styles.xml
new file mode 100644
index 0000000..57f07ac
--- /dev/null
+++ b/res/values-sw600dp-port/styles.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+-->
+
+<resources>
+    <style name="TabIndicator.AppsCustomize">
+        <item name="android:maxWidth">180dp</item>
+    </style>
+</resources>
diff --git a/res/values-sw600dp/styles.xml b/res/values-sw600dp/styles.xml
index e0542ba..87110da 100644
--- a/res/values-sw600dp/styles.xml
+++ b/res/values-sw600dp/styles.xml
@@ -114,6 +114,7 @@
         <item name="android:paddingLeft">32dp</item>
         <item name="android:paddingRight">32dp</item>
         <item name="android:textSize">14sp</item>
+        <item name="android:maxWidth">240dp</item>
     </style>
 
     <!-- QSB Search / Drop Target bar -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 502a836..909887c 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -161,13 +161,15 @@
         <item name="android:layout_width">wrap_content</item>
         <item name="android:layout_height">match_parent</item>
         <item name="android:gravity">center</item>
-        <item name="android:paddingLeft">24dp</item>
-        <item name="android:paddingRight">24dp</item>
+        <item name="android:paddingLeft">20dp</item>
+        <item name="android:paddingRight">20dp</item>
         <item name="android:background">@drawable/tab_widget_indicator_selector</item>
         <item name="android:textColor">?android:attr/textColorPrimary</item>
         <item name="android:textSize">12sp</item>
         <item name="android:textStyle">bold</item>
         <item name="android:textAllCaps">true</item>
+        <item name="android:singleLine">true</item>
+        <item name="android:ellipsize">end</item>
     </style>
     <style name="TabIndicator.AppsCustomize">
         <!-- Overridden in values-land -->
diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/android/launcher2/DragLayer.java
index 873803d..9154771 100644
--- a/src/com/android/launcher2/DragLayer.java
+++ b/src/com/android/launcher2/DragLayer.java
@@ -632,6 +632,12 @@
 
     @Override
     protected int getChildDrawingOrder(int childCount, int i) {
+        // We don't want to prioritize the workspace drawing on top of the other children in
+        // landscape for the overscroll event.
+        if (LauncherApplication.isScreenLandscape(getContext())) {
+            return super.getChildDrawingOrder(childCount, i);
+        }
+
         if (mWorkspaceIndex == -1 || mQsbIndex == -1 || 
                 mLauncher.getWorkspace().isDrawingBackgroundGradient()) {
             return i;
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index e1377fc..467cec0 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -3521,11 +3521,13 @@
         mOverscrollFade = fade;
         float reducedFade = 0.5f + 0.5f * (1 - fade);
         final ViewGroup parent = (ViewGroup) getParent();
+        final ImageView qsbDivider = (ImageView) (parent.findViewById(R.id.qsb_divider));
         final ImageView dockDivider = (ImageView) (parent.findViewById(R.id.dock_divider));
         final ImageView scrollIndicator = getScrollingIndicator();
 
         cancelScrollingIndicatorAnimations();
-        dockDivider.setAlpha(reducedFade);
+        if (qsbDivider != null) qsbDivider.setAlpha(reducedFade);
+        if (dockDivider != null) dockDivider.setAlpha(reducedFade);
         scrollIndicator.setAlpha(1 - fade);
     }
 }