Updating background assets for contact list
Change-Id: I10e040d385a9ca877d94783f11c7d4ae393a9178
diff --git a/res/drawable-hdpi/list_focused_holo.9.png b/res/drawable-hdpi/list_focused_holo.9.png
new file mode 100644
index 0000000..ef52862
--- /dev/null
+++ b/res/drawable-hdpi/list_focused_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/list_normal_holo.9.png b/res/drawable-hdpi/list_normal_holo.9.png
new file mode 100644
index 0000000..b7e8d11
--- /dev/null
+++ b/res/drawable-hdpi/list_normal_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/section_header_holo.9.png b/res/drawable-hdpi/section_header_holo.9.png
index de12d0e..133cd58 100644
--- a/res/drawable-hdpi/section_header_holo.9.png
+++ b/res/drawable-hdpi/section_header_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/list_focused_holo.9.png b/res/drawable-mdpi/list_focused_holo.9.png
new file mode 100644
index 0000000..76dbb4b
--- /dev/null
+++ b/res/drawable-mdpi/list_focused_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/list_normal_holo.9.png b/res/drawable-mdpi/list_normal_holo.9.png
new file mode 100644
index 0000000..58a82b9
--- /dev/null
+++ b/res/drawable-mdpi/list_normal_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/section_header_holo.9.png b/res/drawable-mdpi/section_header_holo.9.png
index de12d0e..7187efd 100644
--- a/res/drawable-mdpi/section_header_holo.9.png
+++ b/res/drawable-mdpi/section_header_holo.9.png
Binary files differ
diff --git a/res/drawable/list_selector.xml b/res/drawable/list_selector.xml
index 7fafe7f..b43852c 100644
--- a/res/drawable/list_selector.xml
+++ b/res/drawable/list_selector.xml
@@ -28,12 +28,9 @@
android:state_focused="false"
android:state_pressed="true"
android:drawable="@drawable/list_pressed_holo" />
-
- <!-- TODO: need a focused state asset -->
<item
android:state_focused="true"
- android:drawable="@drawable/list_pressed_holo" />
-
+ android:drawable="@drawable/list_focused_holo" />
<item
android:drawable="@android:color/transparent" />
</selector>
diff --git a/res/layout-xlarge/total_contacts.xml b/res/layout-xlarge/total_contacts.xml
index 8c05119..c824b02 100644
--- a/res/layout-xlarge/total_contacts.xml
+++ b/res/layout-xlarge/total_contacts.xml
@@ -20,6 +20,7 @@
android:layout_height="47dip"
android:paddingLeft="5dp"
android:paddingRight="7dp"
+ android:background="@drawable/list_normal_holo"
>
<TextView
diff --git a/res/values-xlarge/styles.xml b/res/values-xlarge/styles.xml
index 49d8fcf..0bd6ae9 100644
--- a/res/values-xlarge/styles.xml
+++ b/res/values-xlarge/styles.xml
@@ -16,7 +16,7 @@
<resources>
<style name="ContactBrowserTheme" parent="@android:Theme.Light.Holo">
<item name="list_item_height">?android:attr/listPreferredItemHeight</item>
- <item name="background">@drawable/list_selector</item>
+ <item name="background">@drawable/list_normal_holo</item>
<item name="activated_background">@drawable/list_item_activated_background</item>
<item name="android:windowBackground">@drawable/contact_list_bg</item>
<item name="android:windowContentOverlay">@null</item>
@@ -42,7 +42,7 @@
<style name="ContactPickerTheme" parent="@android:Theme.Holo.Light.Dialog">
<item name="list_item_height">?android:attr/listPreferredItemHeight</item>
- <item name="background">@drawable/list_selector</item>
+ <item name="background">@drawable/list_normal_holo</item>
<item name="section_header_background">@drawable/section_header_holo</item>
<item name="list_item_divider">@drawable/list_item_divider_holo</item>
<item name="list_item_padding_top">0dip</item>
diff --git a/src/com/android/contacts/list/ContactListItemView.java b/src/com/android/contacts/list/ContactListItemView.java
index 5c74832..29d4a41 100644
--- a/src/com/android/contacts/list/ContactListItemView.java
+++ b/src/com/android/contacts/list/ContactListItemView.java
@@ -77,6 +77,7 @@
private final int mHeaderTextIndent;
private final int mHeaderTextSize;
+ private Drawable mBackgroundDrawable;
private Drawable mActivatedBackgroundDrawable;
private boolean mHorizontalDividerVisible = true;
@@ -157,6 +158,8 @@
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.ContactListItemView);
mPreferredHeight = a.getDimensionPixelSize(
R.styleable.ContactListItemView_list_item_height, 0);
+ mBackgroundDrawable = a.getDrawable(
+ R.styleable.ContactListItemView_background);
mActivatedBackgroundDrawable = a.getDrawable(
R.styleable.ContactListItemView_activated_background);
mHeaderBackgroundDrawable = a.getDrawable(
@@ -320,6 +323,8 @@
mBoundsWithoutHeader.set(0, topBound, width, bottomBound);
+ mBackgroundDrawable.setBounds(0, topBound, width, height);
+
if (mActivatedStateSupported) {
mActivatedBackgroundDrawable.setBounds(mBoundsWithoutHeader);
}
@@ -505,6 +510,9 @@
@Override
public void dispatchDraw(Canvas canvas) {
+ if (!isActivated()) {
+ mBackgroundDrawable.draw(canvas);
+ }
if (mActivatedStateSupported) {
mActivatedBackgroundDrawable.draw(canvas);
}