Merge "Handle requery cursor null when getRefreshDeletions is called"
diff --git a/res/layout-sw600dp/account_switch_spinner_item.xml b/res/layout-sw600dp/account_switch_spinner_item.xml
index ead0665..b0cbab7 100644
--- a/res/layout-sw600dp/account_switch_spinner_item.xml
+++ b/res/layout-sw600dp/account_switch_spinner_item.xml
@@ -17,49 +17,41 @@
 -->
 
     <!-- style="@style/AccountSwitchSpinnerItem" -->
-<LinearLayout
+<RelativeLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_height="match_parent"
     android:layout_width="match_parent"
     android:paddingLeft="0dip"
     android:layout_marginLeft="0dip">
 
-    <!-- This spacer is here just to soak up horizontal space. -->
-    <!-- If this is omitted, the spinner triangle is too far from the text. -->
-    <FrameLayout
-        android:id="@+id/spinner_frame"
+    <LinearLayout
+        android:id="@+id/spinner"
         android:layout_width="@dimen/spinner_frame_width"
         android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:gravity="center_vertical"
+        android:background="@drawable/spinner_ab_holo_light"
         android:layout_alignParentLeft="true">
-
-            <!-- style="?android:attr/actionDropDownStyle" -->
-        <LinearLayout
-            android:id="@+id/spinner"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:orientation="vertical"
-            android:gravity="center_vertical">
-            <TextView
-                android:id="@+id/account_spinner_folder"
-                style="@android:style/TextAppearance.Holo.Widget.ActionBar.Title.Inverse"
-                android:singleLine="true"
-                android:ellipsize="end"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content" />
-            <TextView
-                android:id="@+id/account_spinner_account_name"
-                style="@android:style/TextAppearance.Holo.Widget.ActionBar.Subtitle.Inverse"
-                android:singleLine="true"
-                android:ellipsize="end"
-                android:layout_marginRight="4dp"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content" />
-        </LinearLayout>
-
-    </FrameLayout>
+        <TextView
+            android:id="@+id/account_spinner_folder"
+            style="@android:style/TextAppearance.Holo.Widget.ActionBar.Title.Inverse"
+            android:singleLine="true"
+            android:ellipsize="end"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+        <TextView
+            android:id="@+id/account_spinner_account_name"
+            style="@android:style/TextAppearance.Holo.Widget.ActionBar.Subtitle.Inverse"
+            android:singleLine="true"
+            android:ellipsize="end"
+            android:layout_marginRight="4dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+    </LinearLayout>
 
     <TextView
         android:id="@+id/unread"
-        style="@style/unreadCountActionBarTablet" />
-
-</LinearLayout>
+        android:layout_marginLeft="4dp"
+        style="@style/UnreadCountActionBar"
+        android:layout_toRightOf="@id/spinner" />
+</RelativeLayout>
diff --git a/res/layout/one_button_button_bar.xml b/res/layout/one_button_button_bar.xml
index 018a177..72910ba 100644
--- a/res/layout/one_button_button_bar.xml
+++ b/res/layout/one_button_button_bar.xml
@@ -34,7 +34,7 @@
         android:measureWithLargestChild="true"
         android:background="@null">
         <Button
-            android:id="@+id/cancel"
+            android:id="@+id/first_button"
             style="?android:attr/buttonBarButtonStyle"
             android:layout_weight="1"
             android:layout_width="0dip"
diff --git a/src/com/android/mail/ui/FolderSelectionActivity.java b/src/com/android/mail/ui/FolderSelectionActivity.java
index 137cc60..bbf8093 100644
--- a/src/com/android/mail/ui/FolderSelectionActivity.java
+++ b/src/com/android/mail/ui/FolderSelectionActivity.java
@@ -89,9 +89,11 @@
         }
 
         mAccount = intent.getParcelableExtra(EXTRA_ACCOUNT_SHORTCUT);
-        Button cancelButton = (Button) findViewById(R.id.cancel);
-        cancelButton.setVisibility(View.VISIBLE);
-        cancelButton.setOnClickListener(this);
+        Button firstButton = (Button) findViewById(R.id.first_button);
+        firstButton.setVisibility(View.VISIBLE);
+        // TODO(mindyp) disable the manage labels buttons until we have a mange labels screen.
+        firstButton.setEnabled(false);
+        firstButton.setOnClickListener(this);
 
         FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
         Fragment fragment = FolderListFragment.newInstance(this, mAccount.folderListUri);
diff --git a/src/com/android/mail/ui/OnePaneController.java b/src/com/android/mail/ui/OnePaneController.java
index f2bcd3a..9074050 100644
--- a/src/com/android/mail/ui/OnePaneController.java
+++ b/src/com/android/mail/ui/OnePaneController.java
@@ -205,6 +205,7 @@
     }
 
     private void transitionToInbox() {
+        mViewMode.enterConversationListMode();
         ConversationListContext listContext = ConversationListContext.forFolder(mContext,
                 mAccount, mInbox);
         // Set the correct context for what the conversation view will be now.
@@ -244,9 +245,9 @@
     }
 
     private void transitionBackToConversationListMode() {
+        mViewMode.enterConversationListMode();
         mActivity.getFragmentManager().popBackStack(mLastConversationTransactionId,
                 FragmentManager.POP_BACK_STACK_INCLUSIVE);
-        mViewMode.enterConversationListMode();
         resetActionBarIcon();
     }
 }