Search in sources :

Example 1 with ContactInfoHelper

use of com.android.dialer.calllog.ContactInfoHelper in project android_packages_apps_Dialer by MoKee.

the class ContactPhotoLoader method createLetterTileDrawable.

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

Example 2 with ContactInfoHelper

use of com.android.dialer.calllog.ContactInfoHelper in project android_packages_apps_Dialer by MoKee.

the class CallDetailActivity method onCreate.

@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    mContext = this;
    mResources = getResources();
    mContactInfoHelper = new ContactInfoHelper(this, GeoUtil.getCurrentCountryIso(this));
    mContactsPreferences = new ContactsPreferences(mContext);
    mCallTypeHelper = new CallTypeHelper(getResources());
    mFilteredNumberAsyncQueryHandler = new FilteredNumberAsyncQueryHandler(getContentResolver());
    mVoicemailUri = getIntent().getParcelableExtra(EXTRA_VOICEMAIL_URI);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    setContentView(R.layout.call_detail);
    mInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
    mHistoryList = (ListView) findViewById(R.id.history);
    mHistoryList.addHeaderView(mInflater.inflate(R.layout.call_detail_header, null));
    mHistoryList.addFooterView(mInflater.inflate(R.layout.call_detail_footer, null), null, false);
    mQuickContactBadge = (QuickContactBadge) findViewById(R.id.quick_contact_photo);
    mQuickContactBadge.setOverlay(null);
    if (CompatUtils.hasPrioritizedMimeType()) {
        mQuickContactBadge.setPrioritizedMimeType(Phone.CONTENT_ITEM_TYPE);
    }
    mCallerName = (TextView) findViewById(R.id.caller_name);
    mCallerNumber = (TextView) findViewById(R.id.caller_number);
    mAccountLabel = (TextView) findViewById(R.id.phone_account_label);
    mContactPhotoManager = ContactPhotoManager.getInstance(this);
    mCallButton = findViewById(R.id.call_back_button);
    mCallButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (TextUtils.isEmpty(mNumber)) {
                return;
            }
            Intent dialIntent = new CallIntentBuilder(getDialableNumber()).setCallInitiationType(LogState.INITIATION_CALL_DETAILS).build();
            if (DialerUtils.isConferenceURICallLog(mNumber, mPostDialDigits)) {
                dialIntent.putExtra("org.codeaurora.extra.DIAL_CONFERENCE_URI", true);
            }
            mContext.startActivity(dialIntent);
        }
    });
    mBlockNumberActionItem = (TextView) findViewById(R.id.call_detail_action_block);
    updateBlockActionItemVisibility(View.VISIBLE);
    mBlockNumberActionItem.setOnClickListener(this);
    mEditBeforeCallActionItem = findViewById(R.id.call_detail_action_edit_before_call);
    mEditBeforeCallActionItem.setOnClickListener(this);
    mReportActionItem = findViewById(R.id.call_detail_action_report);
    mReportActionItem.setOnClickListener(this);
    mCopyNumberActionItem = findViewById(R.id.call_detail_action_copy);
    mCopyNumberActionItem.setOnClickListener(this);
    if (getIntent().getBooleanExtra(EXTRA_FROM_NOTIFICATION, false)) {
        closeSystemDialogs();
    }
}
Also used : CallTypeHelper(com.android.dialer.calllog.CallTypeHelper) ContactsPreferences(com.android.contacts.common.preference.ContactsPreferences) ContactInfoHelper(com.android.dialer.calllog.ContactInfoHelper) CallIntentBuilder(com.android.dialer.util.IntentUtil.CallIntentBuilder) FilteredNumberAsyncQueryHandler(com.android.dialer.database.FilteredNumberAsyncQueryHandler) Intent(android.content.Intent) View(android.view.View) TextView(android.widget.TextView) ListView(android.widget.ListView)

Example 3 with ContactInfoHelper

use of com.android.dialer.calllog.ContactInfoHelper in project android_packages_apps_Dialer by MoKee.

the class VoicemailArchiveActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.call_log_fragment);
    // Make window opaque to reduce overdraw
    getWindow().setBackgroundDrawable(null);
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowHomeEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setElevation(0);
    mCallLogQueryHandler = new CallLogQueryHandler(this, getContentResolver(), this);
    mVoicemailPlaybackPresenter = VoicemailArchivePlaybackPresenter.getInstance(this, savedInstanceState);
    mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    mRecyclerView.setHasFixedSize(true);
    mLayoutManager = new LinearLayoutManager(this);
    mRecyclerView.setLayoutManager(mLayoutManager);
    mEmptyListView = (EmptyContentView) findViewById(R.id.empty_list_view);
    mEmptyListView.setDescription(R.string.voicemail_archive_empty);
    mEmptyListView.setImage(R.drawable.empty_call_log);
    mAdapter = ObjectFactory.newCallLogAdapter(this, this, new ContactInfoHelper(this, GeoUtil.getCurrentCountryIso(this)), mVoicemailPlaybackPresenter, CallLogAdapter.ACTIVITY_TYPE_ARCHIVE);
    mRecyclerView.setAdapter(mAdapter);
    fetchCalls();
}
Also used : ContactInfoHelper(com.android.dialer.calllog.ContactInfoHelper) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ActionBar(android.support.v7.app.ActionBar) CallLogQueryHandler(com.android.dialer.calllog.CallLogQueryHandler)

Example 4 with ContactInfoHelper

use of com.android.dialer.calllog.ContactInfoHelper in project android_packages_apps_Dialer by MoKee.

the class CallStatsDetailActivity method onCreate.

@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.call_stats_detail);
    mResources = getResources();
    mContactInfoHelper = new ContactInfoHelper(this, GeoUtil.getCurrentCountryIso(this));
    mFilteredNumberAsyncQueryHandler = new FilteredNumberAsyncQueryHandler(getContentResolver());
    mQuickContactBadge = (QuickContactBadge) findViewById(R.id.quick_contact_photo);
    mQuickContactBadge.setOverlay(null);
    mQuickContactBadge.setPrioritizedMimeType(Phone.CONTENT_ITEM_TYPE);
    mCallerName = (TextView) findViewById(R.id.caller_name);
    mCallerNumber = (TextView) findViewById(R.id.caller_number);
    mCallButton = (View) findViewById(R.id.call_back_button);
    mCallButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            startActivity(CallUtil.getCallIntent(mNumber));
        }
    });
    mDurationBar = (LinearColorBar) findViewById(R.id.duration_number_percent_bar);
    mTotalDurationBar = (LinearColorBar) findViewById(R.id.duration_total_percent_bar);
    mTotalDuration = (TextView) findViewById(R.id.total_duration_number);
    mTotalTotalDuration = (TextView) findViewById(R.id.total_duration_total);
    mInDuration = new DetailLine(R.id.in_duration, R.string.call_stats_incoming, Calls.INCOMING_TYPE);
    mOutDuration = new DetailLine(R.id.out_duration, R.string.call_stats_outgoing, Calls.OUTGOING_TYPE);
    mCountBar = (LinearColorBar) findViewById(R.id.count_number_percent_bar);
    mTotalCountBar = (LinearColorBar) findViewById(R.id.count_total_percent_bar);
    mTotalCount = (TextView) findViewById(R.id.total_count_number);
    mTotalTotalCount = (TextView) findViewById(R.id.total_count_total);
    mInCount = new DetailLine(R.id.in_count, R.string.call_stats_incoming, Calls.INCOMING_TYPE);
    mOutCount = new DetailLine(R.id.out_count, R.string.call_stats_outgoing, Calls.OUTGOING_TYPE);
    mMissedCount = new DetailLine(R.id.missed_count, R.string.call_stats_missed, Calls.MISSED_TYPE);
    mBlockedCount = new DetailLine(R.id.blocked_count, R.string.call_stats_blocked, Calls.BLOCKED_TYPE);
    mInAverage = new DetailLine(R.id.in_average, R.string.call_stats_incoming, Calls.INCOMING_TYPE);
    mOutAverage = new DetailLine(R.id.out_average, R.string.call_stats_outgoing, Calls.OUTGOING_TYPE);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    Intent launchIntent = getIntent();
    mData = (CallStatsDetails) launchIntent.getParcelableExtra(EXTRA_DETAILS);
    mTotalData = (CallStatsDetails) launchIntent.getParcelableExtra(EXTRA_TOTAL);
    updateData();
    updateFilteredNumberChanges();
    TextView dateFilterView = (TextView) findViewById(R.id.date_filter);
    long filterFrom = launchIntent.getLongExtra(EXTRA_FROM, -1);
    if (filterFrom == -1) {
        dateFilterView.setVisibility(View.GONE);
    } else {
        long filterTo = launchIntent.getLongExtra(EXTRA_TO, -1);
        dateFilterView.setText(DateUtils.formatDateRange(this, filterFrom, filterTo, 0));
    }
}
Also used : ContactInfoHelper(com.android.dialer.calllog.ContactInfoHelper) FilteredNumberAsyncQueryHandler(com.android.dialer.database.FilteredNumberAsyncQueryHandler) Intent(android.content.Intent) TextView(android.widget.TextView) View(android.view.View) TextView(android.widget.TextView) CallTypeIconsView(com.android.dialer.calllog.CallTypeIconsView)

Aggregations

ContactInfoHelper (com.android.dialer.calllog.ContactInfoHelper)4 Intent (android.content.Intent)2 View (android.view.View)2 TextView (android.widget.TextView)2 FilteredNumberAsyncQueryHandler (com.android.dialer.database.FilteredNumberAsyncQueryHandler)2 ActionBar (android.support.v7.app.ActionBar)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 ListView (android.widget.ListView)1 LetterTileDrawable (com.android.contacts.common.lettertiles.LetterTileDrawable)1 ContactsPreferences (com.android.contacts.common.preference.ContactsPreferences)1 CallLogQueryHandler (com.android.dialer.calllog.CallLogQueryHandler)1 CallTypeHelper (com.android.dialer.calllog.CallTypeHelper)1 CallTypeIconsView (com.android.dialer.calllog.CallTypeIconsView)1 CallIntentBuilder (com.android.dialer.util.IntentUtil.CallIntentBuilder)1