Search in sources :

Example 1 with ContactInfoHelper

use of com.android.dialer.phonenumbercache.ContactInfoHelper in project android_packages_apps_Dialer by LineageOS.

the class CallLogFragment method setupData.

protected void setupData() {
    int activityType = mIsCallLogActivity ? CallLogAdapter.ACTIVITY_TYPE_CALL_LOG : CallLogAdapter.ACTIVITY_TYPE_DIALTACTS;
    String currentCountryIso = GeoUtil.getCurrentCountryIso(getActivity());
    mContactInfoCache = new ContactInfoCache(ExpirableCacheHeadlessFragment.attach((AppCompatActivity) getActivity()).getRetainedCache(), new ContactInfoHelper(getActivity(), currentCountryIso), mOnContactInfoChangedListener);
    mAdapter = Bindings.getLegacy(getActivity()).newCallLogAdapter(getActivity(), mRecyclerView, this, this, activityType == CallLogAdapter.ACTIVITY_TYPE_DIALTACTS ? (CallLogAdapter.OnActionModeStateChangedListener) getActivity() : null, new CallLogCache(getActivity()), mContactInfoCache, getVoicemailPlaybackPresenter(), new FilteredNumberAsyncQueryHandler(getActivity()), activityType);
    mRecyclerView.setAdapter(mAdapter);
    fetchCalls();
}
Also used : CallLogCache(com.android.dialer.app.calllog.calllogcache.CallLogCache) ContactInfoHelper(com.android.dialer.phonenumbercache.ContactInfoHelper) AppCompatActivity(android.support.v7.app.AppCompatActivity) FilteredNumberAsyncQueryHandler(com.android.dialer.blocking.FilteredNumberAsyncQueryHandler) ContactInfoCache(com.android.dialer.app.contactinfo.ContactInfoCache)

Example 2 with ContactInfoHelper

use of com.android.dialer.phonenumbercache.ContactInfoHelper in project android_packages_apps_Dialer by LineageOS.

the class ContactPhotoLoader method createLetterTileDrawable.

/**
 * @return a {@link LetterTileDrawable} based on the ContactInfo.
 */
private Drawable createLetterTileDrawable() {
    ContactInfoHelper helper = new ContactInfoHelper(mContext, GeoUtil.getCurrentCountryIso(mContext));
    LetterTileDrawable drawable = new LetterTileDrawable(mContext.getResources());
    drawable.setCanonicalDialerLetterTileDetails(mContactInfo.name, mContactInfo.lookupKey, LetterTileDrawable.SHAPE_CIRCLE, helper.isBusiness(mContactInfo.sourceType) ? LetterTileDrawable.TYPE_BUSINESS : LetterTileDrawable.TYPE_DEFAULT);
    return drawable;
}
Also used : ContactInfoHelper(com.android.dialer.phonenumbercache.ContactInfoHelper) LetterTileDrawable(com.android.contacts.common.lettertiles.LetterTileDrawable)

Example 3 with ContactInfoHelper

use of com.android.dialer.phonenumbercache.ContactInfoHelper in project android_packages_apps_Dialer by LineageOS.

the class CallLogNotificationsQueryHelper method getInstance.

/**
 * Returns an instance of {@link CallLogNotificationsQueryHelper}.
 */
public static CallLogNotificationsQueryHelper getInstance(Context context) {
    ContentResolver contentResolver = context.getContentResolver();
    String countryIso = GeoUtil.getCurrentCountryIso(context);
    return new CallLogNotificationsQueryHelper(context, createNewCallsQuery(context, contentResolver), new ContactInfoHelper(context, countryIso), countryIso);
}
Also used : ContactInfoHelper(com.android.dialer.phonenumbercache.ContactInfoHelper) ContentResolver(android.content.ContentResolver)

Aggregations

ContactInfoHelper (com.android.dialer.phonenumbercache.ContactInfoHelper)3 ContentResolver (android.content.ContentResolver)1 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 LetterTileDrawable (com.android.contacts.common.lettertiles.LetterTileDrawable)1 CallLogCache (com.android.dialer.app.calllog.calllogcache.CallLogCache)1 ContactInfoCache (com.android.dialer.app.contactinfo.ContactInfoCache)1 FilteredNumberAsyncQueryHandler (com.android.dialer.blocking.FilteredNumberAsyncQueryHandler)1