Merge "Giving more space to the tab bar to prevent the tabs from shrinking in size in portrait." 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-it/strings.xml b/res/values-it/strings.xml
index 327d90d..f935303 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -88,7 +88,7 @@
     <string name="workspace_scroll_format" msgid="7911126267695001437">"Area di lavoro %1$d di %2$d"</string>
     <string name="apps_customize_apps_scroll_format" msgid="5494241912377704885">"Pagina di applicazioni %1$d di %2$d"</string>
     <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"Pagina di widget %1$d di %2$d"</string>
-    <string name="workspace_cling_title" msgid="738396473989890567">"Mettiti comodo"</string>
+    <string name="workspace_cling_title" msgid="738396473989890567">"Personalizza la schermata home"</string>
     <string name="workspace_cling_move_item" msgid="791013895761065070">"Puoi posizionare le tue applicazioni preferite qui."</string>
     <string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"Per visualizzare tutte le tue applicazioni, tocca il cerchio."</string>
     <string name="all_apps_cling_title" msgid="2559734712581447107">"Scegli alcune applicazioni"</string>
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-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index 398d81a..db74198 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -69,9 +69,9 @@
     <string name="cab_menu_delete_app" msgid="4089398025537640349">"Desinstalar a aplicação"</string>
     <string name="cab_menu_app_info" msgid="914548323652698884">"Detalhes da aplicação"</string>
     <string name="cab_app_selection_text" msgid="6378522164293415735">"1 aplicação selecionada"</string>
-    <string name="cab_widget_selection_text" msgid="962527270506951955">"1 widget seleccionado"</string>
-    <string name="cab_folder_selection_text" msgid="8916111874189565067">"1 pasta seleccionada"</string>
-    <string name="cab_shortcut_selection_text" msgid="8115847384500412878">"1 atalho seleccionado"</string>
+    <string name="cab_widget_selection_text" msgid="962527270506951955">"1 widget selecionado"</string>
+    <string name="cab_folder_selection_text" msgid="8916111874189565067">"1 pasta selecionada"</string>
+    <string name="cab_shortcut_selection_text" msgid="8115847384500412878">"1 atalho selecionado"</string>
     <string name="permlab_install_shortcut" msgid="1201690825493376489">"instalar atalhos"</string>
     <string name="permdesc_install_shortcut" msgid="8634424803272077038">"Permite que uma aplicação adicione atalhos sem a intervenção do utilizador."</string>
     <string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"desinstalar atalhos"</string>
diff --git a/res/values-sw/strings.xml b/res/values-sw/strings.xml
index df786fb..490979e 100644
--- a/res/values-sw/strings.xml
+++ b/res/values-sw/strings.xml
@@ -36,7 +36,7 @@
     <string name="rename_action" msgid="6016003384693240896">"Sawa"</string>
     <string name="cancel_action" msgid="3811860427489435048">"Ghairi"</string>
     <string name="menu_item_add_item" msgid="6233177331075781114">"Ongeza kwa skrini ya Nyumbani"</string>
-    <string name="group_applications" msgid="2103752818818161976">"Prog"</string>
+    <string name="group_applications" msgid="2103752818818161976">"Programu"</string>
     <string name="group_shortcuts" msgid="9133529424900391877">"Njia za mkato"</string>
     <string name="group_widgets" msgid="6704978494073105844">"Wijeti"</string>
     <string name="group_wallpapers" msgid="1568191644272224858">"Mandhari"</string>
@@ -56,7 +56,7 @@
     <string name="info_target_label" msgid="4019495079517426980">"Maelezo ya programu"</string>
     <string name="accessibility_search_button" msgid="816822994629942611">"Tafuta"</string>
     <string name="accessibility_voice_search_button" msgid="3938249215065842475">"Utafutaji wa Sauti"</string>
-    <string name="accessibility_all_apps_button" msgid="8803738611398979849">"Prog"</string>
+    <string name="accessibility_all_apps_button" msgid="8803738611398979849">"Programu"</string>
     <string name="accessibility_delete_button" msgid="3628162007991023603">"Ondoa"</string>
     <string name="delete_zone_label_all_apps_system_app" msgid="3683920959591819044">"Sanidua sasisho"</string>
     <string name="menu_add" msgid="3065046628354640854">"Ongeza"</string>
@@ -99,7 +99,7 @@
     <string name="cling_dismiss" msgid="2780907108735868381">"Sawa"</string>
     <string name="folder_opened" msgid="4129072635480822768">"Folda imefunguliwa,%1$d na %2$d"</string>
     <string name="folder_tap_to_close" msgid="4076794242530255812">"Gonga ili kufunga folda"</string>
-    <string name="folder_tap_to_rename" msgid="2125528923948315223">"Gonga kukubali jina"</string>
+    <string name="folder_tap_to_rename" msgid="2125528923948315223">"Gonga ili kukubali jina"</string>
     <string name="folder_closed" msgid="3130534551370511932">"Folda imefungwa"</string>
     <string name="folder_renamed" msgid="781234745487414781">"Folda imebadilishwa jina hadi %1$s"</string>
     <string name="folder_name_format" msgid="4513766553514769310">"Folda: %1$s"</string>
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/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index b732eec..7f0edde 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -24,7 +24,6 @@
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
-import android.content.pm.ActivityInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.content.res.Configuration;
@@ -443,22 +442,6 @@
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
     }
 
-    /** Removes and returns the ResolveInfo with the specified ComponentName */
-    private ResolveInfo removeResolveInfoWithComponentName(List<ResolveInfo> list,
-            ComponentName cn) {
-        Iterator<ResolveInfo> iter = list.iterator();
-        while (iter.hasNext()) {
-            ResolveInfo rinfo = iter.next();
-            ActivityInfo info = rinfo.activityInfo;
-            ComponentName c = new ComponentName(info.packageName, info.name);
-            if (c.equals(cn)) {
-                iter.remove();
-                return rinfo;
-            }
-        }
-        return null;
-    }
-
     public void onPackagesUpdated() {
         // TODO: this isn't ideal, but we actually need to delay here. This call is triggered
         // by a broadcast receiver, and in order for it to work correctly, we need to know that
@@ -992,10 +975,7 @@
     private void renderDrawableToBitmap(Drawable d, Bitmap bitmap, int x, int y, int w, int h) {
         renderDrawableToBitmap(d, bitmap, x, y, w, h, 1f, 0xFFFFFFFF);
     }
-    private void renderDrawableToBitmap(Drawable d, Bitmap bitmap, int x, int y, int w, int h,
-            float scale) {
-        renderDrawableToBitmap(d, bitmap, x, y, w, h, scale, 0xFFFFFFFF);
-    }
+
     private void renderDrawableToBitmap(Drawable d, Bitmap bitmap, int x, int y, int w, int h,
             float scale, int multiplyColor) {
         if (bitmap != null) {
diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java
index 49c47ce..dc498a4 100644
--- a/src/com/android/launcher2/BubbleTextView.java
+++ b/src/com/android/launcher2/BubbleTextView.java
@@ -16,8 +16,6 @@
 
 package com.android.launcher2;
 
-import com.android.launcher.R;
-
 import android.content.Context;
 import android.content.res.Resources;
 import android.graphics.Bitmap;
@@ -30,9 +28,10 @@
 import android.graphics.drawable.Drawable;
 import android.util.AttributeSet;
 import android.view.MotionEvent;
-import android.view.View;
 import android.widget.TextView;
 
+import com.android.launcher.R;
+
 /**
  * TextView that draws a bubble behind the text. We cannot use a LineBackgroundSpan
  * because we want to make the bubble taller than the text and TextView's clip is
diff --git a/src/com/android/launcher2/ButtonDropTarget.java b/src/com/android/launcher2/ButtonDropTarget.java
index 868ede8..4ff7c96 100644
--- a/src/com/android/launcher2/ButtonDropTarget.java
+++ b/src/com/android/launcher2/ButtonDropTarget.java
@@ -20,7 +20,6 @@
 import android.content.res.Resources;
 import android.graphics.Paint;
 import android.util.AttributeSet;
-import android.widget.FrameLayout;
 import android.widget.TextView;
 
 import com.android.launcher.R;
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 6e60280..8aae809 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -18,7 +18,6 @@
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
-import android.animation.AnimatorSet;
 import android.animation.ObjectAnimator;
 import android.animation.PropertyValuesHolder;
 import android.animation.TimeInterpolator;
diff --git a/src/com/android/launcher2/DeleteDropTarget.java b/src/com/android/launcher2/DeleteDropTarget.java
index 4e93b22..f199708 100644
--- a/src/com/android/launcher2/DeleteDropTarget.java
+++ b/src/com/android/launcher2/DeleteDropTarget.java
@@ -23,7 +23,6 @@
 import android.graphics.PorterDuff;
 import android.graphics.PorterDuffColorFilter;
 import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
 import android.graphics.drawable.TransitionDrawable;
 import android.util.AttributeSet;
 import android.view.View;
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java
index 286e2fe..a120ac5 100644
--- a/src/com/android/launcher2/DragController.java
+++ b/src/com/android/launcher2/DragController.java
@@ -20,7 +20,6 @@
 import android.graphics.Bitmap;
 import android.graphics.Point;
 import android.graphics.Rect;
-import android.graphics.RectF;
 import android.os.Handler;
 import android.os.IBinder;
 import android.os.Vibrator;
diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/android/launcher2/DragLayer.java
index 3c626d4..9154771 100644
--- a/src/com/android/launcher2/DragLayer.java
+++ b/src/com/android/launcher2/DragLayer.java
@@ -199,7 +199,6 @@
 
     private void sendTapOutsideFolderAccessibilityEvent(boolean isEditingName) {
         if (AccessibilityManager.getInstance(mContext).isEnabled()) {
-            Folder currentFolder = mLauncher.getWorkspace().getOpenFolder();
             int stringId = isEditingName ? R.string.folder_tap_to_rename : R.string.folder_tap_to_close;
             AccessibilityEvent event = AccessibilityEvent.obtain(
                     AccessibilityEvent.TYPE_VIEW_FOCUSED);
@@ -633,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/FocusHelper.java b/src/com/android/launcher2/FocusHelper.java
index 1a7416a..7807b5d 100644
--- a/src/com/android/launcher2/FocusHelper.java
+++ b/src/com/android/launcher2/FocusHelper.java
@@ -23,7 +23,6 @@
 import android.view.ViewParent;
 import android.widget.TabHost;
 import android.widget.TabWidget;
-import android.widget.TextView;
 
 import com.android.launcher.R;
 
@@ -118,13 +117,6 @@
     }
 
     /**
-     * Private helper to determine whether a view is visible.
-     */
-    private static boolean isVisible(View v) {
-        return v.getVisibility() == View.VISIBLE;
-    }
-
-    /**
      * Returns the Viewgroup containing page contents for the page at the index specified.
      */
     private static ViewGroup getAppsCustomizePage(ViewGroup container, int index) {
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java
index 546f4b5..3c0829d 100644
--- a/src/com/android/launcher2/FolderIcon.java
+++ b/src/com/android/launcher2/FolderIcon.java
@@ -32,7 +32,6 @@
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
-import android.view.accessibility.AccessibilityEvent;
 import android.view.animation.AccelerateInterpolator;
 import android.view.animation.DecelerateInterpolator;
 import android.widget.ImageView;
diff --git a/src/com/android/launcher2/HandleView.java b/src/com/android/launcher2/HandleView.java
index e2e5745..13d07e2 100644
--- a/src/com/android/launcher2/HandleView.java
+++ b/src/com/android/launcher2/HandleView.java
@@ -71,11 +71,6 @@
         return super.onTouchEvent(ev);
     }
 
-    private static boolean isDirectionKey(int keyCode) {
-        return keyCode == KeyEvent.KEYCODE_DPAD_DOWN || keyCode == KeyEvent.KEYCODE_DPAD_LEFT ||
-                keyCode == KeyEvent.KEYCODE_DPAD_RIGHT || keyCode == KeyEvent.KEYCODE_DPAD_UP;
-    }
-
     void setLauncher(Launcher launcher) {
         mLauncher = launcher;
     }
diff --git a/src/com/android/launcher2/IconCache.java b/src/com/android/launcher2/IconCache.java
index a0412af..2430a6b 100644
--- a/src/com/android/launcher2/IconCache.java
+++ b/src/com/android/launcher2/IconCache.java
@@ -221,7 +221,6 @@
     public HashMap<ComponentName,Bitmap> getAllIcons() {
         synchronized (mCache) {
             HashMap<ComponentName,Bitmap> set = new HashMap<ComponentName,Bitmap>();
-            int i = 0;
             for (ComponentName cn : mCache.keySet()) {
                 final CacheEntry e = mCache.get(cn);
                 set.put(cn, e.icon);
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 33ead5c..864fca5 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1398,11 +1398,6 @@
         return mWorkspaceLoading || mWaitingForResult;
     }
 
-    private void addItems() {
-        showWorkspace(true);
-        showAddDialog();
-    }
-
     private void resetAddInfo() {
         mPendingAddInfo.container = ItemInfo.NO_ID;
         mPendingAddInfo.screen = -1;
@@ -1560,13 +1555,6 @@
         sFolders.remove(folder.id);
     }
 
-    private void showNotifications() {
-        final StatusBarManager statusBar = (StatusBarManager) getSystemService(STATUS_BAR_SERVICE);
-        if (statusBar != null) {
-            statusBar.expand();
-        }
-    }
-
     private void startWallpaper() {
         showWorkspace(true);
         final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER);
@@ -2932,6 +2920,7 @@
             final CellLayout layoutParent = (CellLayout) workspace.getChildAt(i);
             layoutParent.removeAllViewsInLayout();
         }
+        mWidgetsToAdvance.clear();
         if (mHotseat != null) {
             mHotseat.resetLayout();
         }
diff --git a/src/com/android/launcher2/LauncherAppWidgetHostView.java b/src/com/android/launcher2/LauncherAppWidgetHostView.java
index 71860f3..0c3bdca 100644
--- a/src/com/android/launcher2/LauncherAppWidgetHostView.java
+++ b/src/com/android/launcher2/LauncherAppWidgetHostView.java
@@ -17,9 +17,7 @@
 package com.android.launcher2;
 
 import android.appwidget.AppWidgetHostView;
-import android.appwidget.AppWidgetProviderInfo;
 import android.content.Context;
-import android.content.res.Resources;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
@@ -35,12 +33,10 @@
     private boolean mHasPerformedLongPress;
     private CheckForLongPress mPendingCheckForLongPress;
     private LayoutInflater mInflater;
-    private Launcher mLauncher;
 
     public LauncherAppWidgetHostView(Context context) {
         super(context);
         mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-        mLauncher = (Launcher) context;
     }
 
     @Override
diff --git a/src/com/android/launcher2/LauncherApplication.java b/src/com/android/launcher2/LauncherApplication.java
index 6c8ba24..9936ca6 100644
--- a/src/com/android/launcher2/LauncherApplication.java
+++ b/src/com/android/launcher2/LauncherApplication.java
@@ -25,8 +25,6 @@
 import android.content.res.Configuration;
 import android.database.ContentObserver;
 import android.os.Handler;
-import android.view.accessibility.AccessibilityEvent;
-import android.view.accessibility.AccessibilityManager;
 
 import java.lang.ref.WeakReference;
 
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
index 50a36a5..7da55db 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -58,7 +58,6 @@
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Locale;
 
 /**
  * Maintains in-memory state of the Launcher. It is expected that there should be only one
@@ -177,12 +176,16 @@
         // Ensure that we don't use the same workspace items data structure on the main thread
         // by making a copy of workspace items first.
         final ArrayList<ItemInfo> workspaceItems = new ArrayList<ItemInfo>(sWorkspaceItems);
+        final ArrayList<ItemInfo> appWidgets = new ArrayList<ItemInfo>(sAppWidgets);
         mHandler.post(new Runnable() {
             @Override
             public void run() {
                for (ItemInfo item : workspaceItems) {
                    item.unbind();
                }
+               for (ItemInfo item : appWidgets) {
+                   item.unbind();
+               }
             }
         });
 
@@ -1230,7 +1233,6 @@
                 }
             });
 
-            // Unbind previously bound workspace items to prevent a leak of AppWidgetHostViews.
             final ArrayList<ItemInfo> workspaceItems = unbindWorkspaceItemsOnMainThread();
 
             // Add the items to the workspace.
@@ -1347,7 +1349,7 @@
 
             // shallow copy
             final ArrayList<ApplicationInfo> list
-                    = (ArrayList<ApplicationInfo>)mAllAppsList.data.clone();
+                    = (ArrayList<ApplicationInfo>) mAllAppsList.data.clone();
             mHandler.post(new Runnable() {
                 public void run() {
                     final long t = SystemClock.uptimeMillis();
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java
index c29e50d..58b87dc 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/android/launcher2/PagedViewCellLayout.java
@@ -19,7 +19,6 @@
 import android.content.Context;
 import android.content.res.Resources;
 import android.util.AttributeSet;
-import android.util.Log;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewDebug;
diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/android/launcher2/PagedViewWidget.java
index 9e668fd..8fcfa8f 100644
--- a/src/com/android/launcher2/PagedViewWidget.java
+++ b/src/com/android/launcher2/PagedViewWidget.java
@@ -42,8 +42,6 @@
 public class PagedViewWidget extends LinearLayout implements Checkable {
     static final String TAG = "PagedViewWidgetLayout";
 
-    private static final int sPreviewFadeInDuration = 80;
-    private static final int sPreviewFadeInStaggerDuration = 20;
     private static boolean sDeletePreviewsWhenDetachedFromWindow = true;
 
     private final Paint mPaint = new Paint();
diff --git a/src/com/android/launcher2/RocketLauncher.java b/src/com/android/launcher2/RocketLauncher.java
index 1c6510f..505ac4c 100644
--- a/src/com/android/launcher2/RocketLauncher.java
+++ b/src/com/android/launcher2/RocketLauncher.java
@@ -21,38 +21,29 @@
 package com.android.launcher2;
 
 import android.animation.AnimatorSet;
-import android.animation.PropertyValuesHolder;
 import android.animation.ObjectAnimator;
 import android.animation.TimeAnimator;
-import android.app.Activity;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
-import android.support.v13.dreams.BasicDream;
 import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Matrix;
-import android.graphics.Paint;
 import android.graphics.Point;
 import android.graphics.Rect;
-import android.graphics.RectF;
 import android.os.Handler;
+import android.support.v13.dreams.BasicDream;
 import android.util.AttributeSet;
 import android.util.DisplayMetrics;
-import android.util.Pair;
-import android.view.Gravity;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
-import android.view.WindowManager;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
-import java.util.HashMap;
-import java.util.Random;
 
 import com.android.launcher.R;
 
+import java.util.HashMap;
+import java.util.Random;
+
 public class RocketLauncher extends BasicDream {
     public static final boolean ROCKET_LAUNCHER = true;
 
diff --git a/src/com/android/launcher2/WallpaperChooserDialogFragment.java b/src/com/android/launcher2/WallpaperChooserDialogFragment.java
index 6e39da2..7c4ac2e 100644
--- a/src/com/android/launcher2/WallpaperChooserDialogFragment.java
+++ b/src/com/android/launcher2/WallpaperChooserDialogFragment.java
@@ -16,7 +16,6 @@
 package com.android.launcher2;
 
 import android.app.Activity;
-import android.app.AlertDialog;
 import android.app.Dialog;
 import android.app.DialogFragment;
 import android.app.WallpaperManager;
@@ -27,20 +26,17 @@
 import android.graphics.BitmapFactory;
 import android.graphics.Canvas;
 import android.graphics.ColorFilter;
-import android.graphics.Paint;
 import android.graphics.drawable.Drawable;
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
-import android.view.ViewGroup;
 import android.view.View.OnClickListener;
+import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.BaseAdapter;
-import android.widget.FrameLayout;
 import android.widget.Gallery;
-import android.widget.GridView;
 import android.widget.ImageView;
 import android.widget.ListAdapter;
 import android.widget.SpinnerAdapter;
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index d4e8ad4..467cec0 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -1521,8 +1521,6 @@
         // We need to add extra padding to the bitmap to make room for the glow effect
         final int bitmapPadding = HolographicOutlineHelper.MAX_OUTER_BLUR_RADIUS;
 
-        CellLayout cl = (CellLayout) getChildAt(0);
-
         int[] size = estimateItemSize(info.spanX, info.spanY, info, false);
 
         // The outline is used to visualize where the item will land if dropped
@@ -1872,9 +1870,6 @@
      * Returns a new bitmap to be used as the object outline, e.g. to visualize the drop location.
      * Responsibility for the bitmap is transferred to the caller.
      */
-    private Bitmap createDragOutline(Bitmap orig, Canvas canvas, int padding, int w, int h) {
-        return createDragOutline(orig, canvas, padding, w, h, null);
-    }
     private Bitmap createDragOutline(Bitmap orig, Canvas canvas, int padding, int w, int h,
             Paint alphaClipPaint) {
         final int outlineColor = getResources().getColor(android.R.color.holo_blue_light);
@@ -3526,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);
     }
 }