Two Pane Actionbar fix
Change-Id: I379045692245296983e91c2a5b5bcffbe0b9602a
diff --git a/res/layout-sw600dp/account_switch_spinner_item.xml b/res/layout-sw600dp/account_switch_spinner_item.xml
index 62acd23..535617b 100644
--- a/res/layout-sw600dp/account_switch_spinner_item.xml
+++ b/res/layout-sw600dp/account_switch_spinner_item.xml
@@ -16,9 +16,9 @@
limitations under the License.
-->
+ <!-- style="@style/AccountSwitchSpinnerItem" -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/AccountSwitchSpinnerItem"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:paddingLeft="0dip"
@@ -32,23 +32,23 @@
android:layout_height="match_parent"
android:layout_alignParentLeft="true">
+ <!-- style="?android:attr/actionDropDownStyle" -->
<LinearLayout
android:id="@+id/spinner"
- style="?android:attr/actionDropDownStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_vertical">
<TextView
android:id="@+id/account_spinner_label"
- style="@style/AccountSpinnerAnchorTextPrimary"
+ 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="@style/AccountSpinnerAnchorTextSecondary"
+ style="@android:style/TextAppearance.Holo.Widget.ActionBar.Subtitle.Inverse"
android:singleLine="true"
android:ellipsize="end"
android:layout_marginRight="4dp"
diff --git a/res/layout-sw600dp/actionbar_subject.xml b/res/layout-sw600dp/actionbar_subject.xml
new file mode 100644
index 0000000..bc67976
--- /dev/null
+++ b/res/layout-sw600dp/actionbar_subject.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2011 Google Inc.
+ Licensed to 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.
+-->
+
+<!-- conversation subject does not appear in action bar on tablets. -->
+<View xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:visibility="gone" />
diff --git a/res/layout-sw600dp/actionbar_view.xml b/res/layout-sw600dp/actionbar_view.xml
new file mode 100644
index 0000000..3a4f37d
--- /dev/null
+++ b/res/layout-sw600dp/actionbar_view.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2011 Google Inc.
+ Licensed to 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.
+-->
+
+<com.android.mail.ui.MailActionBar
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:email="http://schemas.android.com/apk/res/com.android.mail"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <!-- Not working currently: no search implemented yet -->
+ <!-- <include layout="@layout/actionbar_searchview" /> -->
+
+ <include layout="@layout/actionbar_label" />
+
+ <include layout="@layout/actionbar_subject" />
+
+</com.android.mail.ui.MailActionBar>
diff --git a/res/layout/actionbar_label.xml b/res/layout/actionbar_label.xml
index 5d887d2..187f814 100644
--- a/res/layout/actionbar_label.xml
+++ b/res/layout/actionbar_label.xml
@@ -23,7 +23,8 @@
android:gravity="center_vertical"
android:layout_height="match_parent"
android:layout_width="match_parent"
- android:layout_marginLeft="4dip">
+ android:layout_marginLeft="4dip"
+ android:visibility="gone" >
<TextView
android:id="@+id/labels"
style="@android:style/TextAppearance.Holo.Widget.ActionBar.Title"
diff --git a/res/layout/actionbar_view.xml b/res/layout/actionbar_view.xml
index 332dd6d..4d658c0 100644
--- a/res/layout/actionbar_view.xml
+++ b/res/layout/actionbar_view.xml
@@ -26,12 +26,6 @@
android:layout_height="match_parent"
android:orientation="horizontal" >
- <com.android.mail.AccountRecentLabelSpinner
- android:id="@+id/account_spinner"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
-<!-- email:dropDownWidth="@dimen/account_dropdown_dropdownwidth" /> -->
-
<include layout="@layout/actionbar_label" />
<include layout="@layout/actionbar_subject" />
diff --git a/src/com/android/mail/ui/AbstractActivityController.java b/src/com/android/mail/ui/AbstractActivityController.java
index 6136a89..6613dbe 100644
--- a/src/com/android/mail/ui/AbstractActivityController.java
+++ b/src/com/android/mail/ui/AbstractActivityController.java
@@ -200,13 +200,11 @@
if (actionBar != null && mActionBarView != null) {
// Why have a different variable for the same thing? We should apply the same actions
// on mActionBarView instead.
- // mSubjectDisplayer = (ConversationSubjectDisplayer) mActionBarView;
mActionBarView.initialize(mActivity, this, mViewMode, actionBar);
actionBar.setCustomView((LinearLayout) mActionBarView, new ActionBar.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM,
- ActionBar.DISPLAY_SHOW_CUSTOM
- | ActionBar.DISPLAY_SHOW_TITLE);
+ ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_TITLE);
}
}
diff --git a/src/com/android/mail/ui/ConversationListFragment.java b/src/com/android/mail/ui/ConversationListFragment.java
index 0cf547f..7ef2c63 100644
--- a/src/com/android/mail/ui/ConversationListFragment.java
+++ b/src/com/android/mail/ui/ConversationListFragment.java
@@ -426,7 +426,7 @@
mAnimateChanges = true;
} else {
mListView.setBackgroundDrawable(null);
- mAnimateChanges = newMode == ViewMode.CONVERSATION_LIST;
+ mAnimateChanges = (newMode == ViewMode.CONVERSATION_LIST);
}
}
/**
diff --git a/src/com/android/mail/ui/MailActionBar.java b/src/com/android/mail/ui/MailActionBar.java
index 950451f..04c61f9 100644
--- a/src/com/android/mail/ui/MailActionBar.java
+++ b/src/com/android/mail/ui/MailActionBar.java
@@ -104,7 +104,6 @@
private MenuItem mSearch;
SpinnerAdapter mSpinner;
- private AccountRecentLabelSpinner mSpinnerView;
/**
* The account currently being shown
*/
@@ -157,24 +156,18 @@
@Override
public void handleRestore(Bundle savedInstanceState) {
- // TODO(viki): Auto-generated method stub
-
}
@Override
public void handleSaveInstanceState(Bundle outState) {
- // TODO(viki): Auto-generated method stub
-
}
@Override
public void initialize(RestrictedActivity activity, ActivityController callback, ViewMode viewMode,
ActionBar actionBar) {
- // TODO(viki): Auto-generated method stub
mActionBar = actionBar;
mCallback = callback;
mActivity = activity;
- mSpinnerView = (AccountRecentLabelSpinner) findViewById(R.id.account_spinner);
// Set the mode to Navigation mode
mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
@@ -199,14 +192,10 @@
@Override
public void onPause() {
- // TODO(viki): Auto-generated method stub
-
}
@Override
public void onResume() {
- // TODO(viki): Auto-generated method stub
-
}
@Override
@@ -249,7 +238,6 @@
switch (mMode){
case ViewMode.UNKNOWN:
- mSpinnerView.setVisibility(VISIBLE);
if (mSearch != null){
mSearch.collapseActionView();
}
@@ -269,7 +257,6 @@
break;
case ViewMode.SEARCH_RESULTS:
mActionBar.setDisplayHomeAsUpEnabled(true);
- mSpinnerView.setVisibility(GONE);
if (mSearch != null) {
mSearch.collapseActionView();
}
diff --git a/src/com/android/mail/ui/TwoPaneController.java b/src/com/android/mail/ui/TwoPaneController.java
index 9fdd3d7..3204e7a 100644
--- a/src/com/android/mail/ui/TwoPaneController.java
+++ b/src/com/android/mail/ui/TwoPaneController.java
@@ -42,7 +42,6 @@
*/
public TwoPaneController(MailActivity activity, ViewMode viewMode) {
super(activity, viewMode);
- // TODO(viki): Auto-generated constructor stub
}
/**
@@ -120,7 +119,7 @@
@Override
public void showConversation(Conversation conversation) {
- // TODO Auto-generated method stub
+ mViewMode.enterConversationMode();
}
@Override
diff --git a/src/com/android/mail/ui/TwoPaneLayout.java b/src/com/android/mail/ui/TwoPaneLayout.java
index 4529081..0d132af 100644
--- a/src/com/android/mail/ui/TwoPaneLayout.java
+++ b/src/com/android/mail/ui/TwoPaneLayout.java
@@ -673,6 +673,12 @@
case ViewMode.CONVERSATION_LIST:
enterConversationListMode();
break;
+ case ViewMode.FOLDER_LIST:
+ // Show Folder lists here
+ break;
+ case ViewMode.SEARCH_RESULTS:
+ // Show search results here
+ break;
}
}
@@ -720,7 +726,7 @@
// Mindy points out that this is strange. Instead of requesting a layout for the labels
// view, we should be requesting a layout for the entire view.
// TODO(viki): Change to this.requestLayout() and see if there is any improvement or loss
- mLabelsView.requestLayout();
+ requestLayout();
}
// TODO(viki): I think most of the next methods aren't being used. Rather than removing them,