Update url bar look & feel
updated assets, layout, search behavior
Change-Id: I05543e57cb9a69e3a7cb5fe9a27648fd7196e51e
diff --git a/res/drawable-mdpi/ic_clear_search_light.png b/res/drawable-mdpi/ic_clear_search_light.png
new file mode 100644
index 0000000..8c66fa1
--- /dev/null
+++ b/res/drawable-mdpi/ic_clear_search_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_favorite_on_normal.png b/res/drawable-mdpi/ic_favorite_on_normal.png
new file mode 100644
index 0000000..b086569
--- /dev/null
+++ b/res/drawable-mdpi/ic_favorite_on_normal.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_search_light.png b/res/drawable-mdpi/ic_search_light.png
new file mode 100644
index 0000000..63c10ab
--- /dev/null
+++ b/res/drawable-mdpi/ic_search_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_voice_search.png b/res/drawable-mdpi/ic_voice_search.png
new file mode 100644
index 0000000..a2fe874
--- /dev/null
+++ b/res/drawable-mdpi/ic_voice_search.png
Binary files differ
diff --git a/res/drawable-mdpi/textfield_active_holo_dark.9.png b/res/drawable-mdpi/textfield_active_holo_dark.9.png
new file mode 100644
index 0000000..d37c8b2
--- /dev/null
+++ b/res/drawable-mdpi/textfield_active_holo_dark.9.png
Binary files differ
diff --git a/res/drawable-mdpi/textfield_default_holo_dark.9.png b/res/drawable-mdpi/textfield_default_holo_dark.9.png
new file mode 100644
index 0000000..ab6abdc
--- /dev/null
+++ b/res/drawable-mdpi/textfield_default_holo_dark.9.png
Binary files differ
diff --git a/res/drawable/btn_star.xml b/res/drawable/btn_star.xml
new file mode 100644
index 0000000..4c3d145
--- /dev/null
+++ b/res/drawable/btn_star.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_activated="true"
+ android:drawable="@drawable/ic_favorite_on_normal" />
+ <item android:state_activated="false"
+ android:drawable="@drawable/ic_favorite_off_normal" />
+</selector>
diff --git a/res/layout/url_bar.xml b/res/layout/url_bar.xml
index 3636ca8..61b03ed 100644
--- a/res/layout/url_bar.xml
+++ b/res/layout/url_bar.xml
@@ -27,89 +27,46 @@
android:src="@drawable/ic_back_normal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- style="@style/HoloButton"
- android:background="@drawable/browserbarbutton" />
+ style="@style/HoloButton" />
<ImageButton
android:id="@+id/forward"
android:src="@drawable/ic_forward_normal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- style="@style/HoloButton"
- android:background="@drawable/browserbarbutton" />
+ style="@style/HoloButton" />
<ImageView
android:id="@+id/stop"
- android:background="@drawable/browserbarbutton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
style="@style/HoloButton"
android:gravity="center_vertical"
android:src="@drawable/ic_stop_normal" />
<LinearLayout
- android:id="@+id/urlbar_unfocused"
+ android:id="@+id/urlbar_focused"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1.0"
- android:background="@null"
- android:orientation="horizontal">
- <ImageView
- android:id="@+id/browsericon"
- android:src="@drawable/ic_web_white"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- style="@style/HoloButton" />
+ android:layout_marginLeft="16dip"
+ android:orientation="horizontal"
+ android:background="@drawable/textfield_active_holo_dark">
<ImageView
android:id="@+id/lock"
android:layout_width="wrap_content"
android:layout_height="match_parent"
style="@style/HoloIcon"
android:visibility="gone" />
- <TextView
- android:id="@+id/url_unfocused"
- android:layout_width="0dip"
- android:layout_weight="1.0"
- android:layout_height="match_parent"
- android:background="@null"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="#ffc0c0c0"
- android:hint="@string/search_hint"
- android:gravity="center_vertical"
- android:singleLine="true"
- android:ellipsize="end"
- android:lines="1"
- android:scrollHorizontally="true" />
- <view class="com.android.browser.TitleBarXLarge$CustomCheck"
- android:id="@+id/star"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- style="@style/HoloButton"
- android:focusable="false"
- android:button="@android:drawable/btn_star"
- android:background="@drawable/browserbarbutton" />
- </LinearLayout>
- <LinearLayout
- android:id="@+id/urlbar_focused"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1.0"
- android:orientation="horizontal"
- android:background="@drawable/text_field_results"
- android:visibility="gone">
- <ImageView
- android:id="@+id/searchicon"
- android:src="@drawable/ic_search_category_suggest"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- style="@style/HoloButton" />
<com.android.browser.UrlInputView
android:id="@+id/url_focused"
android:layout_width="0dip"
android:layout_weight="1.0"
android:layout_height="match_parent"
+ android:layout_marginTop="12dip"
+ android:layout_marginLeft="16dip"
+ android:paddingLeft="0dip"
+ android:paddingRight="0dip"
android:background="@null"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/black"
android:hint="@string/search_hint"
- android:gravity="center_vertical"
android:singleLine="true"
android:ellipsize="end"
android:lines="1"
@@ -118,8 +75,14 @@
android:imeOptions="actionGo"
style="@style/Suggestions" />
<ImageView
+ android:id="@+id/star"
+ android:src="@drawable/btn_star"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ style="@style/HoloButton" />
+ <ImageView
android:id="@+id/clear"
- android:src="@drawable/ic_clear_search"
+ android:src="@drawable/ic_clear_search_light"
android:layout_width="wrap_content"
android:layout_height="match_parent"
style="@style/HoloButton" />
@@ -131,23 +94,27 @@
android:layout_height="match_parent"
android:visibility="gone"
android:gravity="center_vertical"
- style="@style/HoloButton"
- android:background="@drawable/browserbarbutton" />
+ style="@style/HoloButton" />
+ <ImageView
+ android:id="@+id/voicesearch"
+ android:src="@drawable/ic_voice_search"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ style="@style/HoloButton" />
<ImageButton
android:id="@+id/search"
android:src="@drawable/ic_search_normal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
- style="@style/HoloButton"
- android:background="@drawable/browserbarbutton" />
+ style="@style/HoloButton" />
<ImageButton
android:id="@+id/all_btn"
android:layout_width="wrap_content"
android:layout_height="match_parent"
+ android:layout_marginRight="4dip"
android:scaleType="center"
style="@style/HoloButton"
- android:background="@drawable/browserbarbutton"
android:src="@drawable/ic_bookmarks_history_normal" />
</LinearLayout>
<com.android.browser.PageProgressView
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 115676c..9df1c3a 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -41,8 +41,7 @@
<item name="android:windowExitAnimation">@anim/title_bar_exit</item>
</style>
<style name="HoloIcon">
- <item name="android:paddingLeft">16dip</item>
- <item name="android:paddingRight">16dip</item>
+ <item name="android:layout_marginLeft">16dip</item>
</style>
<style name="HoloButton" parent="@style/HoloIcon">
<item name="android:background">@drawable/browserbarbutton</item>