@Override public void onAttach(Activity activity) { if (DEBUG) Log.d(TAG, "onAttach()"); super.onAttach(activity); // Construct two base adapters which will become part of PhoneFavoriteMergedAdapter. // We don't construct the resultant adapter at this moment since it requires LayoutInflater // that will be available on onCreateView(). mContactTileAdapter = new PhoneFavoritesTileAdapter(activity, mContactTileAdapterListener, this); mContactTileAdapter.setPhotoLoader(ContactPhotoManager.getInstance(activity)); }
protected void configurePhotoLoader() { if (isPhotoLoaderEnabled() && mContext != null) { if (mPhotoManager == null) { mPhotoManager = ContactPhotoManager.getInstance(mContext); } if (mListView != null) { mListView.setOnScrollListener(this); } if (mAdapter != null) { mAdapter.setPhotoLoader(mPhotoManager); } } }
public static BlockedNumbersAdapter newBlockedNumbersAdapter( Context context, FragmentManager fragmentManager) { return new BlockedNumbersAdapter( context, fragmentManager, new ContactInfoHelper(context, GeoUtil.getCurrentCountryIso(context)), ContactPhotoManager.getInstance(context)); }
public static ViewNumbersToImportAdapter newViewNumbersToImportAdapter( Context context, FragmentManager fragmentManager) { return new ViewNumbersToImportAdapter( context, fragmentManager, new ContactInfoHelper(context, GeoUtil.getCurrentCountryIso(context)), ContactPhotoManager.getInstance(context)); }
public void updatePhoto() { quickContactView.assignContactUri(info.lookupUri); final boolean isVoicemail = mCallLogCache.isVoicemailNumber(accountHandle, number); int contactType = ContactPhotoManager.TYPE_DEFAULT; if (isVoicemail) { contactType = ContactPhotoManager.TYPE_VOICEMAIL; } else if (isBusiness) { contactType = ContactPhotoManager.TYPE_BUSINESS; } final String lookupKey = info.lookupUri != null ? UriUtils.getLookupKeyFromUri(info.lookupUri) : null; final String displayName = TextUtils.isEmpty(info.name) ? displayNumber : info.name; final DefaultImageRequest request = new DefaultImageRequest( displayName, lookupKey, contactType, true /* isCircular */); if (info.photoId == 0 && info.photoUri != null) { ContactPhotoManager.getInstance(mContext).loadPhoto(quickContactView, info.photoUri, mPhotoSize, false /* darkTheme */, true /* isCircular */, request); } else { ContactPhotoManager.getInstance(mContext).loadThumbnail(quickContactView, info.photoId, false /* darkTheme */, true /* isCircular */, request); } if (mExtendedBlockingButtonRenderer != null) { mExtendedBlockingButtonRenderer.updatePhotoAndLabelIfNecessary( number, countryIso, quickContactView, phoneCallDetailsViews.callLocationAndDate); } }
ContactPhotoManager.getInstance(this).loadPhoto(mContactPhoto, photoUri, mPhotoSize, false /* darkTheme */, true /* isCircular */, request); } else { ContactPhotoManager.getInstance(this).loadThumbnail(mContactPhoto, photoId, false /* darkTheme */, true /* isCircular */, request);
mCallerNumber = (TextView) findViewById(R.id.caller_number); mAccountLabel = (TextView) findViewById(R.id.phone_account_label); mContactPhotoManager = ContactPhotoManager.getInstance(this);