From 6144d027255568a76adf8c36b96af8e283460622 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Wed, 23 Apr 2014 18:17:27 -0700 Subject: Disable quickcontactbadge in AllContactsFragment Disable the quick contacts badge in AllContactsFragment and just use the regular photo ImageView so that contact photos can be made round and have the overlay removed without affecting other apps that use the QuickContactsBadge (e.g. Gmail). Also tag the view with the contactUri so that it can be used to bring up the QuickContactActivity when clicked. Bug: 13747208 Change-Id: I02288fd64d133d75c7b5e635d9b450f0b2cf7673 --- src/com/android/dialer/list/AllContactsFragment.java | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/com/android/dialer/list/AllContactsFragment.java b/src/com/android/dialer/list/AllContactsFragment.java index ba482030a..50f23aa0a 100644 --- a/src/com/android/dialer/list/AllContactsFragment.java +++ b/src/com/android/dialer/list/AllContactsFragment.java @@ -16,6 +16,9 @@ package com.android.dialer.list; +import android.database.Cursor; +import android.net.Uri; +import android.provider.ContactsContract.QuickContact; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -35,7 +38,7 @@ import com.android.dialer.R; public class AllContactsFragment extends ContactEntryListFragment { public AllContactsFragment() { - setQuickContactEnabled(true); + setQuickContactEnabled(false); setPhotoLoaderEnabled(true); setSectionHeaderDisplayEnabled(true); setDarkTheme(false); @@ -44,7 +47,13 @@ public class AllContactsFragment extends ContactEntryListFragment parent, View view, int position, long id) { - ContactListItemView contactListItemView = (ContactListItemView) view; - QuickContactBadge quickContact = contactListItemView.getQuickContact(); - quickContact.onClick(quickContact); + final Uri uri = (Uri) view.getTag(); + if (uri != null) { + QuickContact.showQuickContact(getActivity(), view, uri, QuickContact.MODE_LARGE, null); + } } @Override -- cgit v1.2.3