Contact filter uses custom UI instead of NotifyingSpinner
Change-Id: Ia51c6944d67e41050be4e3e60856b15b77ffa090
diff --git a/res/layout/filter_spinner.xml b/res/layout/filter_spinner.xml
deleted file mode 100644
index 21c591f..0000000
--- a/res/layout/filter_spinner.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 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"
- class="com.android.contacts.list.FilterSpinnerItemView"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:gravity="left">
-
- <ImageView
- android:id="@+id/icon"
- android:scaleType="fitCenter"
- android:layout_width="24dip"
- android:layout_height="24dip"
- android:layout_marginLeft="8dip"
- />
-
- <TextView
- android:id="@+id/label"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="8dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:gravity="center_vertical"
- android:ellipsize="end"
- />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="8dip"
- android:layout_gravity="bottom"
- android:src="@drawable/filter_selector_corner"
- />
-</view>
-
diff --git a/res/layout/filter_spinner_item.xml b/res/layout/filter_spinner_item.xml
index b05a019..6573a30 100644
--- a/res/layout/filter_spinner_item.xml
+++ b/res/layout/filter_spinner_item.xml
@@ -16,7 +16,7 @@
<view
xmlns:android="http://schemas.android.com/apk/res/android"
- class="com.android.contacts.list.FilterSpinnerItemView"
+ class="com.android.contacts.list.ContactListFilterView"
android:layout_height="52dip"
android:layout_width="fill_parent"
android:paddingLeft="7dip"
diff --git a/res/layout/navigation_bar.xml b/res/layout/navigation_bar.xml
index c90f563..6286b1c 100644
--- a/res/layout/navigation_bar.xml
+++ b/res/layout/navigation_bar.xml
@@ -25,7 +25,8 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingRight="10dip"
- android:minWidth="240dip">
+ android:minWidth="240dip"
+ android:background="@drawable/filter_selector_background">
<TextView
android:id="@+id/search_label"
android:layout_width="wrap_content"
@@ -34,12 +35,36 @@
android:gravity="center_vertical" />
<view
- class="com.android.contacts.widget.NotifyingSpinner"
- android:id="@+id/filter_spinner"
- android:layout_width="wrap_content"
+ class="com.android.contacts.list.ContactListFilterView"
+ android:id="@+id/filter_view"
android:layout_height="match_parent"
- android:prompt="@string/list_filter_prompt"
- android:background="@drawable/filter_selector_background" />
+ android:layout_width="match_parent"
+ android:gravity="center_vertical">
+
+ <ImageView
+ android:id="@+id/icon"
+ android:scaleType="fitCenter"
+ android:layout_width="24dip"
+ android:layout_height="24dip"
+ android:layout_marginLeft="8dip" />
+
+ <TextView
+ android:id="@+id/label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="8dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:gravity="center_vertical"
+ android:ellipsize="end" />
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="8dip"
+ android:layout_gravity="bottom"
+ android:src="@drawable/filter_selector_corner" />
+ </view>
+
</FrameLayout>
<view
diff --git a/res/values-xlarge/styles.xml b/res/values-xlarge/styles.xml
index 1e06a44..8abb44c 100644
--- a/res/values-xlarge/styles.xml
+++ b/res/values-xlarge/styles.xml
@@ -34,6 +34,7 @@
<item name="list_item_header_text_width">56dip</item>
<item name="list_item_photo_size">64dip</item>
<item name="list_item_prefix_highlight_color">#729a27</item>
+ <item name="contact_filter_popup_width">320dip</item>
</style>
<style name="ContactPickerTheme" parent="@android:Theme.Dialog">
diff --git a/res/values/styles.xml b/res/values/styles.xml
index b8d9c54..71b653a 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -100,6 +100,10 @@
<item name="android:windowExitAnimation">@anim/dummy_animation</item>
</style>
+ <declare-styleable name="ContactBrowser">
+ <attr name="contact_filter_popup_width" format="dimension"/>
+ </declare-styleable>
+
<declare-styleable name="ContactListItemView">
<!-- An attribute that specifies a custom drawable for the pressed state in the contact list-->
<attr name="pressedBackground" format="reference"/>
@@ -117,7 +121,6 @@
<attr name="list_item_header_text_width" format="dimension"/>
<attr name="list_item_photo_size" format="dimension"/>
<attr name="list_item_prefix_highlight_color" format="color"/>
-
</declare-styleable>
<declare-styleable name="MultiplePhonePickerItemView">
@@ -142,6 +145,7 @@
<item name="list_item_header_text_width">56dip</item>
<item name="list_item_photo_size">56dip</item>
<item name="list_item_prefix_highlight_color">#729a27</item>
+ <item name="contact_filter_popup_width">320dip</item>
</style>
<style name="ContactPickerTheme" parent="@android:Theme">