diff options
9 files changed, 59 insertions, 39 deletions
diff --git a/java/com/android/contacts/common/res/layout/search_bar_expanded.xml b/java/com/android/contacts/common/res/layout/search_bar_expanded.xml index 7192eb030..f0179ad30 100644 --- a/java/com/android/contacts/common/res/layout/search_bar_expanded.xml +++ b/java/com/android/contacts/common/res/layout/search_bar_expanded.xml @@ -13,20 +13,19 @@ See the License for the specific language governing permissions and limitations under the License. --> -<LinearLayout +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/search_box_expanded" android:layout_width="match_parent" android:layout_height="match_parent" - android:gravity="center_vertical" - android:orientation="horizontal" android:visibility="gone"> <ImageButton android:id="@+id/search_back_button" android:layout_width="@dimen/search_box_icon_size" android:layout_height="@dimen/search_box_icon_size" - android:layout_margin="@dimen/search_box_navigation_icon_margin" + android:layout_marginStart="16dp" + android:layout_centerVertical="true" android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="@string/action_menu_back_from_search" android:src="@drawable/quantum_ic_arrow_back_vd_theme_24" @@ -34,15 +33,17 @@ <EditText android:id="@+id/search_view" - android:layout_width="0dp" - android:layout_height="@dimen/search_box_icon_size" - android:layout_weight="1" - android:layout_marginLeft="@dimen/search_box_text_left_margin" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_toEndOf="@+id/search_back_button" + android:layout_toStartOf="@+id/search_close_button" + android:layout_centerVertical="true" + android:layout_marginStart="8dp" android:background="@null" android:fontFamily="@string/search_font_family" android:imeOptions="flagNoExtractUi" android:inputType="textFilter" - android:singleLine="true" + android:maxLines="1" android:textColor="@color/searchbox_text_color" android:textColorHint="@color/searchbox_hint_text_color" android:textCursorDrawable="@drawable/searchedittext_custom_cursor" @@ -52,11 +53,12 @@ android:id="@+id/search_close_button" android:layout_width="@dimen/search_box_close_icon_size" android:layout_height="@dimen/search_box_close_icon_size" + android:layout_alignParentEnd="true" + android:layout_centerVertical="true" android:padding="@dimen/search_box_close_icon_padding" android:background="?attr/selectableItemBackgroundBorderless" android:clickable="true" android:contentDescription="@string/description_clear_search" android:src="@drawable/quantum_ic_close_vd_theme_24" android:tint="@color/searchbox_icon_tint"/> - -</LinearLayout> +</RelativeLayout> diff --git a/java/com/android/contacts/common/res/values/colors.xml b/java/com/android/contacts/common/res/values/colors.xml index 1f46233c4..3044339fd 100644 --- a/java/com/android/contacts/common/res/values/colors.xml +++ b/java/com/android/contacts/common/res/values/colors.xml @@ -68,7 +68,7 @@ <color name="actionbar_unselected_text_color">#a6ffffff</color> <!-- Text color of the search box text as entered by user --> - <color name="searchbox_text_color">#000000</color> + <color name="searchbox_text_color">@color/dialer_primary_text_color</color> <!-- Background color of the search box --> <color name="searchbox_background_color">#ffffff</color> diff --git a/java/com/android/contacts/common/res/values/dimens.xml b/java/com/android/contacts/common/res/values/dimens.xml index 19b27b8c6..1ad9b30b0 100644 --- a/java/com/android/contacts/common/res/values/dimens.xml +++ b/java/com/android/contacts/common/res/values/dimens.xml @@ -80,7 +80,7 @@ <!-- Left margin of the text field in the search box. --> <dimen name="search_box_text_left_margin">15dp</dimen> <!-- Search box text size --> - <dimen name="search_text_size">20sp</dimen> + <dimen name="search_text_size">16sp</dimen> <dimen name="contact_list_card_elevation">2dp</dimen> diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java index a4c075c51..74bc8cc33 100644 --- a/java/com/android/dialer/app/DialtactsActivity.java +++ b/java/com/android/dialer/app/DialtactsActivity.java @@ -419,6 +419,7 @@ public class DialtactsActivity extends TransactionSafeActivity mSearchView = searchEditTextLayout.findViewById(R.id.search_view); mSearchView.addTextChangedListener(mPhoneSearchQueryTextListener); + mSearchView.setHint(getSearchBoxHint()); mVoiceSearchButton = searchEditTextLayout.findViewById(R.id.voice_search_button); searchEditTextLayout .findViewById(R.id.search_box_collapsed) diff --git a/java/com/android/dialer/app/res/layout/search_edittext.xml b/java/com/android/dialer/app/res/layout/search_edittext.xml index bb6a5f7de..63786dfb0 100644 --- a/java/com/android/dialer/app/res/layout/search_edittext.xml +++ b/java/com/android/dialer/app/res/layout/search_edittext.xml @@ -1,4 +1,18 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2017 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. +--> <view xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/search_view_container" class="com.android.dialer.app.widget.SearchEditTextLayout" @@ -13,20 +27,18 @@ android:theme="@style/DialtactsSearchBarThemeOverlay" android:orientation="horizontal"> - <LinearLayout + <RelativeLayout android:id="@+id/search_box_collapsed" android:layout_width="match_parent" android:layout_height="match_parent" android:background="?android:selectableItemBackground" - android:paddingStart="@dimen/search_box_left_padding" - android:gravity="center_vertical" - android:orientation="horizontal"> + android:gravity="center_vertical"> <ImageView android:id="@+id/search_magnifying_glass" android:layout_width="@dimen/search_box_icon_size" android:layout_height="@dimen/search_box_icon_size" - android:padding="@dimen/search_box_search_icon_padding" + android:layout_marginStart="8dp" android:importantForAccessibility="no" android:scaleType="center" android:src="@drawable/quantum_ic_search_vd_theme_24" @@ -34,10 +46,11 @@ <TextView android:id="@+id/search_box_start_search" - android:layout_width="0dp" + android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_weight="1" - android:layout_marginLeft="@dimen/search_box_collapsed_text_margin_left" + android:layout_toEndOf="@+id/search_magnifying_glass" + android:layout_toStartOf="@+id/voice_search_button" + android:layout_marginStart="8dp" android:fontFamily="@string/search_font_family" android:gravity="center_vertical" android:hint="@string/dialer_hint_find_contact" @@ -48,6 +61,7 @@ android:id="@+id/voice_search_button" android:layout_width="@dimen/search_box_icon_size" android:layout_height="match_parent" + android:layout_toStartOf="@+id/dialtacts_options_menu_button" android:background="?android:attr/selectableItemBackgroundBorderless" android:clickable="true" android:contentDescription="@string/description_start_voice_search" @@ -59,15 +73,13 @@ android:id="@+id/dialtacts_options_menu_button" android:layout_width="@dimen/search_box_icon_size" android:layout_height="match_parent" - android:paddingEnd="@dimen/search_box_right_padding" + android:layout_alignParentEnd="true" android:background="?android:attr/selectableItemBackgroundBorderless" android:contentDescription="@string/action_menu_overflow_description" android:scaleType="center" android:src="@drawable/quantum_ic_more_vert_white_24" android:tint="@color/searchbox_icon_tint"/> - - </LinearLayout> + </RelativeLayout> <include layout="@layout/search_bar_expanded"/> - </view> diff --git a/java/com/android/dialer/app/res/values/dimens.xml b/java/com/android/dialer/app/res/values/dimens.xml index 5f252ee89..fdbcac93a 100644 --- a/java/com/android/dialer/app/res/values/dimens.xml +++ b/java/com/android/dialer/app/res/values/dimens.xml @@ -61,11 +61,9 @@ <dimen name="search_top_margin">8dp</dimen> <!-- Margin below the search box. --> <dimen name="search_bottom_margin">8dp</dimen> - <dimen name="search_collapsed_text_size">14sp</dimen> + <dimen name="search_collapsed_text_size">16sp</dimen> <!-- Search box interior padding - left --> - <dimen name="search_box_left_padding">8dp</dimen> - <!-- Search box interior padding - right --> - <dimen name="search_box_right_padding">8dp</dimen> + <dimen name="search_box_left_padding">4dp</dimen> <dimen name="search_box_search_icon_padding">2dp</dimen> <dimen name="search_box_collapsed_text_margin_left">22dp</dimen> <dimen name="search_list_padding_top">16dp</dimen> diff --git a/java/com/android/dialer/searchfragment/common/res/layout/search_contact_row.xml b/java/com/android/dialer/searchfragment/common/res/layout/search_contact_row.xml index dd871af70..407207a83 100644 --- a/java/com/android/dialer/searchfragment/common/res/layout/search_contact_row.xml +++ b/java/com/android/dialer/searchfragment/common/res/layout/search_contact_row.xml @@ -36,13 +36,13 @@ android:layout_height="wrap_content" android:layout_toEndOf="@+id/photo" android:layout_toStartOf="@+id/call_to_action" - android:layout_centerVertical="true"> + android:layout_centerVertical="true" + android:layout_marginStart="8dp"> <TextView android:id="@+id/primary" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="@dimen/search_text_padding_start" android:gravity="center_vertical|start" android:fontFamily="sans-serif" style="@style/PrimaryText"/> @@ -51,7 +51,6 @@ android:id="@+id/secondary" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="@dimen/search_text_padding_start" android:gravity="center_vertical|start" android:fontFamily="sans-serif" style="@style/SecondaryText"/> diff --git a/java/com/android/dialer/searchfragment/common/res/values/dimens.xml b/java/com/android/dialer/searchfragment/common/res/values/dimens.xml index f6664163c..fabb0309f 100644 --- a/java/com/android/dialer/searchfragment/common/res/values/dimens.xml +++ b/java/com/android/dialer/searchfragment/common/res/values/dimens.xml @@ -18,5 +18,5 @@ <dimen name="search_row_height">56dp</dimen> <dimen name="search_photo_padding">8dp</dimen> <dimen name="call_to_action_padding">8dp</dimen> - <dimen name="search_text_padding_start">16dp</dimen> + <dimen name="search_text_padding_start">8dp</dimen> </resources>
\ No newline at end of file diff --git a/java/com/android/dialer/searchfragment/list/res/layout/header_layout.xml b/java/com/android/dialer/searchfragment/list/res/layout/header_layout.xml index eef0dee94..6eb1d2e40 100644 --- a/java/com/android/dialer/searchfragment/list/res/layout/header_layout.xml +++ b/java/com/android/dialer/searchfragment/list/res/layout/header_layout.xml @@ -14,10 +14,18 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> -<TextView xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/header" +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="8dp" - android:paddingStart="16dp" - style="@style/SecondaryText"/> + android:layout_height="48dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + android:layout_marginBottom="2dp"> + + <TextView + android:id="@+id/header" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + style="@style/SecondaryText"/> +</FrameLayout> |