summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-04-29 18:13:46 -0700
committerYorke Lee <yorkelee@google.com>2014-04-30 11:50:15 -0700
commit53a2230258d105299c7f1b8bbd25de54fed5d66a (patch)
tree5555a7370250124ed9f6414c6de04331cb06a79e /res
parent87cf81d2608fd4fa7b3e254c6ea1b509ff5bcc54 (diff)
Use EditText for search in ActionBar
SearchView is too limited in terms of customizability for the kind of UI styling we are trying to do. All we really need is a space to enter text into, so use a EditText embedded in a custom ActionBar view instead. Bug: 13932490 Change-Id: I7081684c46b29b416dd6d0e5fcff249ee6f00405
Diffstat (limited to 'res')
-rw-r--r--res/layout/dialtacts_activity.xml47
-rw-r--r--res/layout/search_edittext.xml48
-rw-r--r--res/menu/dialtacts_options.xml9
-rw-r--r--res/values/dimens.xml4
4 files changed, 51 insertions, 57 deletions
diff --git a/res/layout/dialtacts_activity.xml b/res/layout/dialtacts_activity.xml
index 6d041034b..2cd796b60 100644
--- a/res/layout/dialtacts_activity.xml
+++ b/res/layout/dialtacts_activity.xml
@@ -46,53 +46,6 @@
android:id="@+id/search_and_remove_view_container"
android:visibility="gone"
>
- <!-- TODO: This is set to visibility:gone for now, should be removed entirely -->
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="@dimen/search_box_height"
- android:id="@+id/search_view_container"
- android:orientation="horizontal"
- android:layout_marginTop="@dimen/search_top_margin"
- android:layout_marginBottom="@dimen/search_bottom_margin"
- android:layout_marginLeft="@dimen/search_margin_horizontal"
- android:layout_marginRight="@dimen/search_margin_horizontal"
- android:paddingLeft="@dimen/search_box_left_padding"
- android:paddingRight="@dimen/search_box_right_padding"
- android:background="@drawable/search_bg"
- android:gravity="center_vertical"
- android:visibility="gone"
- >
- <EditText
- android:id="@+id/search_view"
- android:layout_width="match_parent"
- android:layout_height="@dimen/search_box_icon_size"
- android:layout_weight="1"
- android:layout_marginLeft="@dimen/search_box_text_left_margin"
- android:textSize="@dimen/search_text_size"
- android:fontFamily="@string/search_font_family"
- android:textColor="@color/searchbox_text_color"
- android:textColorHint="@color/searchbox_hint_text_color"
- android:inputType="textFilter"/>
- <ImageView
- android:id="@+id/search_close_button"
- android:layout_height="@dimen/search_box_icon_size"
- android:layout_width="@dimen/search_box_icon_size"
- android:padding="6dp"
- android:src="@drawable/ic_close_dk"
- android:clickable="true"
- android:background="?android:attr/selectableItemBackground"
- android:contentDescription="@string/description_clear_search"
- android:visibility="gone" />
- <ImageView
- android:id="@+id/voice_search_button"
- android:layout_height="@dimen/search_box_icon_size"
- android:layout_width="@dimen/search_box_icon_size"
- android:padding="@dimen/search_box_icon_padding"
- android:src="@drawable/ic_voice_search"
- android:clickable="true"
- android:contentDescription="@string/description_start_voice_search"
- android:background="?android:attr/selectableItemBackground" />
- </LinearLayout>
<com.android.dialer.list.RemoveView
android:layout_width="match_parent"
android:layout_height="56dp"
diff --git a/res/layout/search_edittext.xml b/res/layout/search_edittext.xml
new file mode 100644
index 000000000..236d2bf93
--- /dev/null
+++ b/res/layout/search_edittext.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/search_view_container"
+ android:orientation="horizontal"
+ android:layout_marginTop="@dimen/search_top_margin"
+ android:layout_marginBottom="@dimen/search_bottom_margin"
+ android:layout_marginLeft="@dimen/search_margin_horizontal"
+ android:layout_marginRight="@dimen/search_margin_horizontal"
+ android:paddingLeft="@dimen/search_box_left_padding"
+ android:paddingRight="@dimen/search_box_right_padding"
+ android:background="@drawable/search_bg"
+ android:gravity="center_vertical"
+ >
+ <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:textSize="@dimen/search_text_size"
+ android:fontFamily="@string/search_font_family"
+ android:textColor="@color/searchbox_text_color"
+ android:textColorHint="@color/searchbox_hint_text_color"
+ android:hint="@string/dialer_hint_find_contact"
+ android:inputType="textFilter"/>
+ <ImageView
+ android:id="@+id/search_close_button"
+ android:layout_height="@dimen/search_box_icon_size"
+ android:layout_width="@dimen/search_box_icon_size"
+ android:padding="6dp"
+ android:src="@drawable/ic_close_dk"
+ android:clickable="true"
+ android:background="?android:attr/selectableItemBackground"
+ android:contentDescription="@string/description_clear_search"
+ android:visibility="gone" />
+ <ImageView
+ android:id="@+id/voice_search_button"
+ android:layout_height="@dimen/search_box_icon_size"
+ android:layout_width="@dimen/search_box_icon_size"
+ android:padding="@dimen/search_box_icon_padding"
+ android:src="@drawable/ic_voice_search"
+ android:clickable="true"
+ android:contentDescription="@string/description_start_voice_search"
+ android:background="?android:attr/selectableItemBackground" />
+</LinearLayout> \ No newline at end of file
diff --git a/res/menu/dialtacts_options.xml b/res/menu/dialtacts_options.xml
index a332030ff..17f4d9fe1 100644
--- a/res/menu/dialtacts_options.xml
+++ b/res/menu/dialtacts_options.xml
@@ -14,16 +14,11 @@
limitations under the License.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:id="@+id/menu_search"
- android:title="@string/description_search_button"
- android:showAsAction="always"
- android:actionViewClass="android.widget.SearchView"/>
+
<item
android:id="@+id/menu_history"
android:icon="@drawable/ic_menu_history_lt"
- android:title="@string/action_menu_call_history_description"
- android:showAsAction="ifRoom"/>
+ android:title="@string/action_menu_call_history_description" />
<item
android:id="@+id/menu_import_export"
android:title="@string/menu_import_export" />
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 66b36a773..57fbe82a5 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -113,11 +113,9 @@
<!-- Margin to the left and right of the search box. -->
<dimen name="search_margin_horizontal">7dp</dimen>
<!-- Margin above the search box. -->
- <dimen name="search_top_margin">10dp</dimen>
+ <dimen name="search_top_margin">4dp</dimen>
<!-- Margin below the search box. -->
<dimen name="search_bottom_margin">4dp</dimen>
- <!-- Height of the search box. -->
- <dimen name="search_box_height">41dp</dimen>
<!-- Search box text size -->
<dimen name="search_text_size">13.24sp</dimen>
<!-- Search box interior padding - left -->