Merge "Extend MailActionBarView with the more debug friendly SearchActionBarView." into jb-ub-mail
diff --git a/res/values-sw720dp-port/constants.xml b/res/values-sw720dp-port/constants.xml
index 1822f5d..577d926 100644
--- a/res/values-sw720dp-port/constants.xml
+++ b/res/values-sw720dp-port/constants.xml
@@ -19,6 +19,12 @@
<!-- Whether the list is collapsed in conversation view mode -->
<bool name="list_collapsed">true</bool>
+ <!-- Search results in portrait mode on 10" tablets should still show wide conversation
+ list items.
+ Note: this this value should be set with the same qualifiers where
+ show_two_pane_search_results is set to false -->
+ <integer name="conversation_list_search_header_mode">0</integer>
+
<!-- Whether to show single or 2 pane search results -->
<bool name="show_two_pane_search_results">false</bool>
</resources>
\ No newline at end of file
diff --git a/res/values-w1000dp/constants.xml b/res/values-w1000dp/constants.xml
new file mode 100644
index 0000000..35093e2
--- /dev/null
+++ b/res/values-w1000dp/constants.xml
@@ -0,0 +1,21 @@
+<?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.
+-->
+<resources>
+ <integer name="conversation_list_header_mode">0</integer>
+ <integer name="conversation_list_search_header_mode">0</integer>
+</resources>
\ No newline at end of file
diff --git a/res/values/constants.xml b/res/values/constants.xml
index 9eeae8e..114c9e3 100644
--- a/res/values/constants.xml
+++ b/res/values/constants.xml
@@ -20,6 +20,7 @@
<integer name="use_tablet_ui">0</integer>
<integer name="conversation_list_header_mode">1</integer>
<integer name="conversation_header_mode">1</integer>
+ <integer name="conversation_list_search_header_mode">1</integer>
<!-- left/right conversations will auto-load if they have no more than this number of messages -->
<integer name="max_auto_load_messages">20</integer>
diff --git a/src/com/android/mail/browse/ConversationItemViewCoordinates.java b/src/com/android/mail/browse/ConversationItemViewCoordinates.java
index 87e3191..8e40874 100644
--- a/src/com/android/mail/browse/ConversationItemViewCoordinates.java
+++ b/src/com/android/mail/browse/ConversationItemViewCoordinates.java
@@ -134,10 +134,17 @@
* Returns the mode of the header view (Wide/Normal/Narrow).
*/
public static int getMode(Context context, ViewMode viewMode) {
- Resources res = context.getResources();
- return viewMode.isListMode() ? res
- .getInteger(R.integer.conversation_list_header_mode) : res
- .getInteger(R.integer.conversation_header_mode);
+ final Resources res = context.getResources();
+ switch (viewMode.getMode()) {
+ case ViewMode.CONVERSATION_LIST:
+ return res.getInteger(R.integer.conversation_list_header_mode);
+
+ case ViewMode.SEARCH_RESULTS_LIST:
+ return res.getInteger(R.integer.conversation_list_search_header_mode);
+
+ default:
+ return res.getInteger(R.integer.conversation_header_mode);
+ }
}
/**