summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-03-20 17:57:47 -0700
committerAndrew Lee <anwlee@google.com>2015-03-23 11:04:44 -0700
commite05a0f5d375168585594fccf68a3ec60a88d4430 (patch)
tree8a8be49328d7340ee196771da8ca789f0ee2cd87
parent6737f31a89e7a3eb52db3ecf281646d9074bde23 (diff)
downloadandroid_packages_apps_ContactsCommon-e05a0f5d375168585594fccf68a3ec60a88d4430.tar.gz
android_packages_apps_ContactsCommon-e05a0f5d375168585594fccf68a3ec60a88d4430.tar.bz2
android_packages_apps_ContactsCommon-e05a0f5d375168585594fccf68a3ec60a88d4430.zip
Change list shortcut item styling.
- Remove background drawable on contact list item view shortcuts. + Swap add person icon from black to white, for tinting. + Tint icons blue instead of white. Bug: 19372539 Change-Id: Ib0353f6e9020bdbc923bacce71bca565a874fabb
-rw-r--r--res/drawable/ic_search_add_contact.xml3
-rw-r--r--res/drawable/search_shortcut_background.xml23
-rw-r--r--res/values/colors.xml3
-rw-r--r--src/com/android/contacts/common/list/ContactListItemView.java16
4 files changed, 10 insertions, 35 deletions
diff --git a/res/drawable/ic_search_add_contact.xml b/res/drawable/ic_search_add_contact.xml
index 36475eb6..9a313cd7 100644
--- a/res/drawable/ic_search_add_contact.xml
+++ b/res/drawable/ic_search_add_contact.xml
@@ -17,5 +17,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_person_add_24dp"
- android:autoMirrored="true"
- android:tint="@color/search_shortcut_icon_color" />
+ android:autoMirrored="true" />
diff --git a/res/drawable/search_shortcut_background.xml b/res/drawable/search_shortcut_background.xml
deleted file mode 100644
index 52b5e3f8..00000000
--- a/res/drawable/search_shortcut_background.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?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.
--->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="oval" >
- <size
- android:height="@dimen/search_shortcut_radius"
- android:width="@dimen/search_shortcut_radius" />
- <solid android:color="@color/search_shortcut_background_color" />
-</shape> \ No newline at end of file
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 376fd3f0..e50be6a9 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -146,8 +146,7 @@
<color name="searchbox_hint_text_color">#737373</color>
<color name="searchbox_icon_tint">@color/searchbox_hint_text_color</color>
- <color name="search_shortcut_background_color">#b6b6b6</color>
- <color name="search_shortcut_icon_color">#f8f8f8</color>
+ <color name="search_shortcut_icon_color">@color/dialtacts_theme_color</color>
<!-- Color of the background of the contact detail and editor pages -->
<color name="background_primary">#f9f9f9</color>
diff --git a/src/com/android/contacts/common/list/ContactListItemView.java b/src/com/android/contacts/common/list/ContactListItemView.java
index c6128847..decf30a0 100644
--- a/src/com/android/contacts/common/list/ContactListItemView.java
+++ b/src/com/android/contacts/common/list/ContactListItemView.java
@@ -23,6 +23,7 @@ import android.database.CharArrayBuffer;
import android.database.Cursor;
import android.graphics.Canvas;
import android.graphics.Color;
+import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
@@ -1499,17 +1500,16 @@ public class ContactListItemView extends ViewGroup
}
/**
- * Set drawable resources directly for both the background and the drawable resource
- * of the photo view
+ * Set drawable resources directly for the drawable resource of the photo view.
*
- * @param backgroundId Id of background resource
- * @param drawableId Id of drawable resource
+ * @param drawableId Id of drawable resource.
*/
- public void setDrawableResource(int backgroundId, int drawableId) {
- final ImageView photo = getPhotoView();
+ public void setDrawableResource(int drawableId) {
+ ImageView photo = getPhotoView();
photo.setScaleType(ImageView.ScaleType.CENTER);
- photo.setBackgroundResource(backgroundId);
- photo.setImageResource(drawableId);
+ photo.setImageDrawable(getContext().getDrawable(drawableId));
+ photo.setImageTintList(ColorStateList.valueOf(
+ getContext().getColor(R.color.search_shortcut_icon_color)));
}
@Override