diff options
Diffstat (limited to 'res/layout')
-rw-r--r-- | res/layout/mail_actionbar_searchview.xml | 48 | ||||
-rw-r--r-- | res/layout/one_pane_activity.xml | 13 | ||||
-rw-r--r-- | res/layout/search_suggestion_item.xml | 47 | ||||
-rw-r--r-- | res/layout/search_suggestion_list.xml | 54 | ||||
-rw-r--r-- | res/layout/toolbar_with_search.xml | 33 | ||||
-rw-r--r-- | res/layout/two_pane_activity.xml | 87 |
6 files changed, 232 insertions, 50 deletions
diff --git a/res/layout/mail_actionbar_searchview.xml b/res/layout/mail_actionbar_searchview.xml index 730f1708a..b7bc1e662 100644 --- a/res/layout/mail_actionbar_searchview.xml +++ b/res/layout/mail_actionbar_searchview.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- - Copyright (C) 2011 Google Inc. + Copyright (C) 2014 Google Inc. Licensed to The Android Open Source Project. Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,12 +16,44 @@ limitations under the License. --> -<android.support.v7.widget.SearchView +<com.android.mail.ui.MaterialSearchActionView xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/search_layout" - android:gravity="center_vertical" - android:layout_height="match_parent" + android:id="@+id/search_actionbar_view" android:layout_width="match_parent" - android:hint="@string/search_hint" - android:imeOptions="actionSearch" - android:maxWidth="@dimen/search_view_width" /> + android:layout_height="match_parent" + android:background="@android:color/white"> + + <ImageView + android:id="@+id/search_actionbar_back_button" + android:layout_width="@dimen/search_leading_button_width" + android:layout_height="match_parent" + android:background="?android:attr/selectableItemBackground" + android:src="@drawable/ic_arrow_back_24dp" + style="@style/SearchViewLeadingButton" /> + + <EditText + android:id="@+id/search_actionbar_query_text" + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="@android:color/transparent" + android:gravity="center_vertical" + android:hint="@string/search_hint" + android:imeOptions="actionSearch|flagNoExtractUi" + android:inputType="text|textNoSuggestions" + android:singleLine="true" + android:textColor="@color/search_query_text" + android:textColorHint="@color/search_query_hint_text" + android:textSize="16sp" /> + + <ImageView + android:id="@+id/search_actionbar_ending_button" + android:layout_width="@dimen/search_ending_button_width" + android:layout_height="match_parent" + android:background="?android:attr/selectableItemBackground" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:scaleType="center" + android:src="@drawable/ic_mic_24dp" /> + +</com.android.mail.ui.MaterialSearchActionView>
\ No newline at end of file diff --git a/res/layout/one_pane_activity.xml b/res/layout/one_pane_activity.xml index 478edb9a9..40072a2a8 100644 --- a/res/layout/one_pane_activity.xml +++ b/res/layout/one_pane_activity.xml @@ -16,7 +16,6 @@ --> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_container" android:layout_width="match_parent" android:layout_height="match_parent"> @@ -27,12 +26,8 @@ android:layout_height="match_parent" android:orientation="vertical"> - <android.support.v7.widget.Toolbar - android:id="@+id/mail_toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="?attr/colorPrimary" - app:theme="?attr/actionBarTheme" /> + <!-- Custom toolbar/search overlay --> + <include layout="@layout/toolbar_with_search" /> <FrameLayout android:layout_width="match_parent" @@ -47,6 +42,8 @@ <include layout="@layout/floating_actions" /> + <include layout="@layout/search_suggestion_list" /> + </FrameLayout> </LinearLayout> @@ -57,4 +54,4 @@ android:layout_height="match_parent" android:layout_gravity="start" /> -</android.support.v4.widget.DrawerLayout> +</android.support.v4.widget.DrawerLayout>
\ No newline at end of file diff --git a/res/layout/search_suggestion_item.xml b/res/layout/search_suggestion_item.xml new file mode 100644 index 000000000..49b0256c9 --- /dev/null +++ b/res/layout/search_suggestion_item.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2014 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. +--> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="@dimen/search_suggestion_height" + android:orientation="vertical"> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center_vertical" + android:paddingRight="16dp"> + + <ImageView + android:id="@+id/search_overlay_item_icon" + android:layout_width="@dimen/search_leading_button_width" + android:layout_height="match_parent" + style="@style/SearchViewLeadingButton" /> + + <TextView + android:id="@+id/search_overlay_item_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_weight="1" + android:textColor="@color/search_suggestion_item_text" + android:textSize="16sp" /> + + </LinearLayout> + +</LinearLayout>
\ No newline at end of file diff --git a/res/layout/search_suggestion_list.xml b/res/layout/search_suggestion_list.xml new file mode 100644 index 000000000..d024ccfe5 --- /dev/null +++ b/res/layout/search_suggestion_list.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2014 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. +--> + +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <com.android.mail.ui.MaterialSearchSuggestionsList + android:id="@+id/search_overlay_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:visibility="gone"> + + <ListView + android:id="@+id/search_overlay_suggestion_list" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@android:color/white" + android:divider="@null" /> + + <!-- Scrim to fade the background --> + <View + android:id="@+id/search_overlay_scrim" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + android:background="#88000000" /> + + </com.android.mail.ui.MaterialSearchSuggestionsList> + + <!-- Search bar shadow --> + <View + android:id="@+id/search_actionbar_shadow" + android:layout_width="match_parent" + android:layout_height="7dp" + android:background="@drawable/action_bar_shadow" + android:visibility="gone" /> +</FrameLayout>
\ No newline at end of file diff --git a/res/layout/toolbar_with_search.xml b/res/layout/toolbar_with_search.xml new file mode 100644 index 000000000..4e5abda14 --- /dev/null +++ b/res/layout/toolbar_with_search.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2014 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. +--> + +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize"> + + <android.support.v7.widget.Toolbar + android:id="@+id/mail_toolbar" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="?attr/colorPrimary" + app:theme="?attr/actionBarTheme" /> + + <include layout="@layout/mail_actionbar_searchview" /> + +</FrameLayout>
\ No newline at end of file diff --git a/res/layout/two_pane_activity.xml b/res/layout/two_pane_activity.xml index 2f8f6db6e..eb194c96c 100644 --- a/res/layout/two_pane_activity.xml +++ b/res/layout/two_pane_activity.xml @@ -15,49 +15,68 @@ See the License for the specific language governing permissions and limitations under the License. --> -<com.android.mail.ui.TwoPaneLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/two_pane_activity" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/tablet_background_gray"> + android:orientation="vertical"> + <!-- Custom toolbar/search overlay --> + <include layout="@layout/toolbar_with_search" /> + + <!-- Main content --> <FrameLayout - android:id="@+id/drawer" - android:layout_width="@dimen/two_pane_drawer_width_open" - android:layout_height="match_parent" - android:layout_gravity="left"> + android:layout_width="match_parent" + android:layout_height="match_parent"> - <include layout="@layout/drawer_fragment" + <com.android.mail.ui.TwoPaneLayout + android:id="@+id/two_pane_activity" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="match_parent" + android:background="@color/tablet_background_gray"> - </FrameLayout> + <FrameLayout + android:id="@+id/drawer" + android:layout_width="@dimen/two_pane_drawer_width_open" + android:layout_height="match_parent" + android:layout_gravity="left"> - <FrameLayout - android:id="@+id/conversation_list_pane" - android:layout_width="0dp" - android:layout_height="match_parent" - android:layout_gravity="left" - style="@style/TwoPaneConversationList" /> - - <com.android.mail.ui.ConversationViewFrame - android:id="@+id/conversation_pane" - android:layout_width="0dp" - android:layout_height="match_parent" - android:layout_gravity="left"> - - <include layout="@layout/conversation_pager" - android:layout_width="match_parent" - android:layout_height="match_parent" /> + <include layout="@layout/drawer_fragment" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + + </FrameLayout> + + <FrameLayout + android:id="@+id/conversation_list_pane" + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_gravity="left" + style="@style/TwoPaneConversationList" /> - </com.android.mail.ui.ConversationViewFrame> + <com.android.mail.ui.ConversationViewFrame + android:id="@+id/conversation_pane" + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_gravity="left"> - <com.android.mail.ui.ConversationViewFrame - android:id="@+id/miscellaneous_pane" - android:layout_width="0dp" - android:layout_height="match_parent" - android:layout_gravity="left" /> + <include layout="@layout/conversation_pager" + android:layout_width="match_parent" + android:layout_height="match_parent" /> - <include layout="@layout/floating_actions" /> + </com.android.mail.ui.ConversationViewFrame> + + <com.android.mail.ui.ConversationViewFrame + android:id="@+id/miscellaneous_pane" + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_gravity="left" /> + + <include layout="@layout/floating_actions" /> + + </com.android.mail.ui.TwoPaneLayout> + + <include layout="@layout/search_suggestion_list" /> + + </FrameLayout> -</com.android.mail.ui.TwoPaneLayout> +</LinearLayout>
\ No newline at end of file |