Fixed contact button in send to labels
Removed the quick contact photo badge on left side
of items in send to group picker fragment. Now entire
row triggers the checkbox.
Test: Verified that change is working as intended in both
send email and send phone number to groups
Bug: 32945249
Change-Id: I29575f9f8e00969376866032fb469d036c8c3272
diff --git a/src/com/android/contacts/common/list/MultiSelectEntryContactListAdapter.java b/src/com/android/contacts/common/list/MultiSelectEntryContactListAdapter.java
index 1a18f46..efba9ca 100644
--- a/src/com/android/contacts/common/list/MultiSelectEntryContactListAdapter.java
+++ b/src/com/android/contacts/common/list/MultiSelectEntryContactListAdapter.java
@@ -22,6 +22,7 @@
import android.view.View;
import android.widget.CheckBox;
+import com.android.contacts.common.ContactPhotoManager;
import com.android.contacts.group.GroupUtil;
import java.util.TreeSet;
@@ -157,6 +158,24 @@
bindCheckBox(view, cursor, partition == ContactsContract.Directory.DEFAULT);
}
+ /**
+ * Loads the photo for the photo view.
+ * @param photoIdColumn Index of the photo id column
+ * @param lookUpKeyColumn Index of the lookup key column
+ * @param displayNameColumn Index of the display name column
+ */
+ protected void bindPhoto(final ContactListItemView view, final Cursor cursor,
+ final int photoIdColumn, final int lookUpKeyColumn, final int displayNameColumn) {
+ final long photoId = cursor.isNull(photoIdColumn)
+ ? 0 : cursor.getLong(photoIdColumn);
+ final ContactPhotoManager.DefaultImageRequest imageRequest = photoId == 0
+ ? getDefaultImageRequestFromCursor(cursor, displayNameColumn,
+ lookUpKeyColumn)
+ : null;
+ getPhotoLoader().loadThumbnail(view.getPhotoView(), photoId, false, getCircularPhotos(),
+ imageRequest);
+ }
+
private void bindCheckBox(ContactListItemView view, Cursor cursor, boolean isLocalDirectory) {
// Disable clicking on all contacts from remote directories when showing check boxes. We do
// this by telling the view to handle clicking itself.
diff --git a/src/com/android/contacts/group/GroupMembersAdapter.java b/src/com/android/contacts/group/GroupMembersAdapter.java
index af1f61e..c501984 100644
--- a/src/com/android/contacts/group/GroupMembersAdapter.java
+++ b/src/com/android/contacts/group/GroupMembersAdapter.java
@@ -150,7 +150,8 @@
final ContactListItemView view = (ContactListItemView) v;
bindSectionHeaderAndDivider(view, position);
bindName(view, cursor);
- bindPhoto(view, cursor);
+ bindPhoto(view, cursor, GroupMembersQuery.CONTACT_PHOTO_ID,
+ GroupMembersQuery.CONTACT_LOOKUP_KEY, GroupMembersQuery.CONTACT_DISPLAY_NAME);
bindDeleteButton(view, position);
}
@@ -169,17 +170,6 @@
getContactNameDisplayOrder());
}
- private void bindPhoto(final ContactListItemView view, Cursor cursor) {
- final long photoId = cursor.isNull(GroupMembersQuery.CONTACT_PHOTO_ID)
- ? 0 : cursor.getLong(GroupMembersQuery.CONTACT_PHOTO_ID);
- final DefaultImageRequest imageRequest = photoId == 0
- ? getDefaultImageRequestFromCursor(cursor, GroupMembersQuery.CONTACT_DISPLAY_NAME,
- GroupMembersQuery.CONTACT_LOOKUP_KEY)
- : null;
- getPhotoLoader().loadThumbnail(view.getPhotoView(), photoId, false, getCircularPhotos(),
- imageRequest);
- }
-
private void bindDeleteButton(final ContactListItemView view, int position) {
if (mDisplayDeleteButtons) {
view.getDeleteImageButton(getDeleteContactListener(), position);
diff --git a/src/com/android/contacts/list/MultiSelectEmailAddressesListAdapter.java b/src/com/android/contacts/list/MultiSelectEmailAddressesListAdapter.java
index af9ee52..7f4bb4b 100644
--- a/src/com/android/contacts/list/MultiSelectEmailAddressesListAdapter.java
+++ b/src/com/android/contacts/list/MultiSelectEmailAddressesListAdapter.java
@@ -29,6 +29,7 @@
import android.provider.ContactsContract.CommonDataKinds.Email;
+import com.android.contacts.common.ContactPhotoManager;
import com.android.contacts.common.list.ContactListItemView;
import com.android.contacts.common.list.MultiSelectEntryContactListAdapter;
import com.android.contacts.common.preference.ContactsPreferences;
@@ -162,9 +163,8 @@
bindViewId(view, cursor, EmailQuery.EMAIL_ID);
if (isFirstEntry) {
bindName(view, cursor);
- bindQuickContact(view, partition, cursor, EmailQuery.PHOTO_ID,
- EmailQuery.PHOTO_URI, EmailQuery.CONTACT_ID,
- EmailQuery.LOOKUP_KEY, EmailQuery.DISPLAY_NAME);
+ bindPhoto(view, cursor, EmailQuery.PHOTO_ID, EmailQuery.LOOKUP_KEY,
+ EmailQuery.DISPLAY_NAME);
} else {
unbindName(view);
view.removePhotoView(true, false);
diff --git a/src/com/android/contacts/list/MultiSelectPhoneNumbersListAdapter.java b/src/com/android/contacts/list/MultiSelectPhoneNumbersListAdapter.java
index 985809b..6bf6d5e 100644
--- a/src/com/android/contacts/list/MultiSelectPhoneNumbersListAdapter.java
+++ b/src/com/android/contacts/list/MultiSelectPhoneNumbersListAdapter.java
@@ -29,6 +29,7 @@
import android.provider.ContactsContract.CommonDataKinds.Phone;
+import com.android.contacts.common.ContactPhotoManager;
import com.android.contacts.common.list.ContactListItemView;
import com.android.contacts.common.list.MultiSelectEntryContactListAdapter;
import com.android.contacts.common.preference.ContactsPreferences;
@@ -162,9 +163,8 @@
bindViewId(view, cursor, PhoneQuery.PHONE_ID);
if (isFirstEntry) {
bindName(view, cursor);
- bindQuickContact(view, partition, cursor, PhoneQuery.PHOTO_ID,
- PhoneQuery.PHOTO_URI, PhoneQuery.CONTACT_ID,
- PhoneQuery.LOOKUP_KEY, PhoneQuery.DISPLAY_NAME);
+ bindPhoto(view, cursor, PhoneQuery.PHOTO_ID, PhoneQuery.LOOKUP_KEY,
+ PhoneQuery.DISPLAY_NAME);
} else {
unbindName(view);
view.removePhotoView(true, false);