Move search_bar_expanded into common
In the process of moving this, I also found and fixed
two bugs.
1) Text size was set incorrectly (looked like a typo)
2) The "up button" used the "content overflow"s content
description
Change-Id: I8d1f1904e3091461f964ba98483a9afbce05fecd
diff --git a/res-common/drawable-hdpi/ic_arrow_back_24dp.png b/res-common/drawable-hdpi/ic_arrow_back_24dp.png
new file mode 100644
index 0000000..86cb894
--- /dev/null
+++ b/res-common/drawable-hdpi/ic_arrow_back_24dp.png
Binary files differ
diff --git a/res-common/drawable-hdpi/ic_close_dk.png b/res-common/drawable-hdpi/ic_close_dk.png
new file mode 100644
index 0000000..f5e378f
--- /dev/null
+++ b/res-common/drawable-hdpi/ic_close_dk.png
Binary files differ
diff --git a/res-common/drawable-mdpi/ic_arrow_back_24dp.png b/res-common/drawable-mdpi/ic_arrow_back_24dp.png
new file mode 100644
index 0000000..dc81cd1
--- /dev/null
+++ b/res-common/drawable-mdpi/ic_arrow_back_24dp.png
Binary files differ
diff --git a/res-common/drawable-mdpi/ic_close_dk.png b/res-common/drawable-mdpi/ic_close_dk.png
new file mode 100644
index 0000000..13f68ee
--- /dev/null
+++ b/res-common/drawable-mdpi/ic_close_dk.png
Binary files differ
diff --git a/res-common/drawable-xhdpi/ic_arrow_back_24dp.png b/res-common/drawable-xhdpi/ic_arrow_back_24dp.png
new file mode 100644
index 0000000..4f4fbaa
--- /dev/null
+++ b/res-common/drawable-xhdpi/ic_arrow_back_24dp.png
Binary files differ
diff --git a/res-common/drawable-xhdpi/ic_close_dk.png b/res-common/drawable-xhdpi/ic_close_dk.png
new file mode 100644
index 0000000..4f965fe
--- /dev/null
+++ b/res-common/drawable-xhdpi/ic_close_dk.png
Binary files differ
diff --git a/res-common/drawable-xxhdpi/ic_arrow_back_24dp.png b/res-common/drawable-xxhdpi/ic_arrow_back_24dp.png
new file mode 100644
index 0000000..46e90f7
--- /dev/null
+++ b/res-common/drawable-xxhdpi/ic_arrow_back_24dp.png
Binary files differ
diff --git a/res-common/drawable-xxhdpi/ic_close_dk.png b/res-common/drawable-xxhdpi/ic_close_dk.png
new file mode 100644
index 0000000..2472da8
--- /dev/null
+++ b/res-common/drawable-xxhdpi/ic_close_dk.png
Binary files differ
diff --git a/res-common/drawable/ic_back_arrow.xml b/res-common/drawable/ic_back_arrow.xml
new file mode 100644
index 0000000..68a875d
--- /dev/null
+++ b/res-common/drawable/ic_back_arrow.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 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
+ -->
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_arrow_back_24dp"
+ android:autoMirrored="true"
+ android:tint="@color/actionbar_icon_color" />
\ No newline at end of file
diff --git a/res-common/layout/search_bar_expanded.xml b/res-common/layout/search_bar_expanded.xml
new file mode 100644
index 0000000..8bd1fff
--- /dev/null
+++ b/res-common/layout/search_bar_expanded.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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:id="@+id/search_box_expanded"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:gravity="center_vertical"
+ 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_icon_margin"
+ android:src="@drawable/ic_back_arrow"
+ android:background="?android:attr/selectableItemBackground"
+ android:contentDescription="@string/action_menu_back_from_search"
+ android:tint="@color/actionbar_background_color" />
+
+ <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:background="@null"
+ android:inputType="textFilter"
+ android:singleLine="true"
+ android:imeOptions="flagNoExtractUi" />
+
+ <ImageView
+ android:id="@+id/search_close_button"
+ android:layout_height="@dimen/search_box_icon_size"
+ android:layout_width="@dimen/search_box_icon_size"
+ android:layout_margin="@dimen/search_box_icon_margin"
+ android:src="@drawable/ic_close_dk"
+ android:clickable="true"
+ android:background="?android:attr/selectableItemBackground"
+ android:contentDescription="@string/description_clear_search" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res-common/values/colors.xml b/res-common/values/colors.xml
index 1d727d5..4e5e3d3 100644
--- a/res-common/values/colors.xml
+++ b/res-common/values/colors.xml
@@ -78,6 +78,10 @@
<!-- Background color of action bars. Ensure this stays in sync with packages/Telephony
actionbar_background_color. -->
<color name="actionbar_background_color">#0fc6dc</color>
+ <!-- Color for icons in the actionbar -->
+ <color name="actionbar_icon_color">#ffffff</color>
+ <!-- Darker version of the actionbar color. Used for the status bar and navigation bar colors. -->
+ <color name="actionbar_background_color_dark">#008aa1</color>
<!-- Color of action bar text. Ensure this stays in sync with packages/Telephony
phone_settings_actionbar_text_color-->
@@ -92,4 +96,11 @@
<color name="dialpad_digits_text_color">#666666</color>
<color name="dialpad_separator_line_color">#dadada</color>
<color name="dialpad_icon_tint">#b3b3b3</color>
+
+ <!-- Text color of the search box text as entered by user -->
+ <color name="searchbox_text_color">#000000</color>
+ <!-- Background color of the search box -->
+ <color name="searchbox_background_color">#ffffff</color>
+ <!-- Text color of the search box hint text -->
+ <color name="searchbox_hint_text_color">#a4a4a4</color>
</resources>
diff --git a/res-common/values/dimens.xml b/res-common/values/dimens.xml
index 5bc73f6..e366689 100644
--- a/res-common/values/dimens.xml
+++ b/res-common/values/dimens.xml
@@ -134,4 +134,13 @@
<dimen name="dialpad_key_button_translate_y">100dp</dimen>
+
+ <!-- Padding around the icon in the search box. -->
+ <dimen name="search_box_icon_margin">4dp</dimen>
+ <!-- Size of the icon (voice search, close search) in the search box. -->
+ <dimen name="search_box_icon_size">28dp</dimen>
+ <!-- Left margin of the text field in the search box. -->
+ <dimen name="search_box_text_left_margin">27dp</dimen>
+ <!-- Search box text size -->
+ <dimen name="search_text_size">14sp</dimen>
</resources>
diff --git a/res-common/values/strings.xml b/res-common/values/strings.xml
index 3f195ad..095157f 100644
--- a/res-common/values/strings.xml
+++ b/res-common/values/strings.xml
@@ -808,4 +808,15 @@
<!-- Font family used when drawing letters for letter tile avatars.
Do not translate. -->
<string name="letter_tile_letter_font_family">sans-serif-thin</string>
+
+ <!-- Content description for the fake action menu up button as used
+ inside search. [CHAR LIMIT=NONE] -->
+ <string name="action_menu_back_from_search">stop searching</string>
+
+ <!-- String describing the icon used to clear the search field -->
+ <string name="description_clear_search">Clear search</string>
+
+ <!-- The font-family to use for the text inside the searchbox.
+ Do not translate. -->
+ <string name="search_font_family">sans-serif</string>
</resources>