Search in sources :

Example 1 with ContactListItemView

use of com.android.contacts.common.list.ContactListItemView in project android_packages_apps_Dialer by LineageOS.

the class BlockedListSearchAdapter method bindView.

@Override
protected void bindView(View itemView, int partition, Cursor cursor, int position) {
    super.bindView(itemView, partition, cursor, position);
    final ContactListItemView view = (ContactListItemView) itemView;
    // Reset view state to unblocked.
    setViewUnblocked(view);
    final String number = getPhoneNumber(position);
    final String countryIso = GeoUtil.getCurrentCountryIso(mContext);
    final FilteredNumberAsyncQueryHandler.OnCheckBlockedListener onCheckListener = new FilteredNumberAsyncQueryHandler.OnCheckBlockedListener() {

        @Override
        public void onCheckComplete(Integer id) {
            if (id != null && id != FilteredNumberAsyncQueryHandler.INVALID_ID) {
                setViewBlocked(view, id);
            }
        }
    };
    mFilteredNumberAsyncQueryHandler.isBlockedNumber(onCheckListener, number, countryIso);
}
Also used : FilteredNumberAsyncQueryHandler(com.android.dialer.blocking.FilteredNumberAsyncQueryHandler) ContactListItemView(com.android.contacts.common.list.ContactListItemView)

Example 2 with ContactListItemView

use of com.android.contacts.common.list.ContactListItemView in project android_packages_apps_Dialer by LineageOS.

the class DialerPhoneNumberListAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    final int shortcutType = getShortcutTypeFromPosition(position);
    if (shortcutType >= 0) {
        if (convertView != null) {
            assignShortcutToView((ContactListItemView) convertView, shortcutType);
            return convertView;
        } else {
            final ContactListItemView v = new ContactListItemView(getContext(), null, mIsImsVideoEnabled);
            assignShortcutToView(v, shortcutType);
            return v;
        }
    } else {
        return super.getView(position, convertView, parent);
    }
}
Also used : ContactListItemView(com.android.contacts.common.list.ContactListItemView)

Example 3 with ContactListItemView

use of com.android.contacts.common.list.ContactListItemView in project android_packages_apps_Dialer by MoKee.

the class BlockedListSearchAdapter method bindView.

@Override
protected void bindView(View itemView, int partition, Cursor cursor, int position) {
    super.bindView(itemView, partition, cursor, position);
    final ContactListItemView view = (ContactListItemView) itemView;
    // Reset view state to unblocked.
    setViewUnblocked(view);
    final String number = getPhoneNumber(position);
    final String countryIso = GeoUtil.getCurrentCountryIso(mContext);
    final FilteredNumberAsyncQueryHandler.OnCheckBlockedListener onCheckListener = new FilteredNumberAsyncQueryHandler.OnCheckBlockedListener() {

        @Override
        public void onCheckComplete(Integer id) {
            if (id != null) {
                setViewBlocked(view, id);
            }
        }
    };
    mFilteredNumberAsyncQueryHandler.isBlockedNumber(onCheckListener, number, countryIso);
}
Also used : FilteredNumberAsyncQueryHandler(com.android.dialer.database.FilteredNumberAsyncQueryHandler) ContactListItemView(com.android.contacts.common.list.ContactListItemView)

Example 4 with ContactListItemView

use of com.android.contacts.common.list.ContactListItemView in project android_packages_apps_Dialer by MoKee.

the class DialerPhoneNumberListAdapter method newView.

@Override
protected ContactListItemView newView(Context context, int partition, Cursor cursor, int position, ViewGroup parent) {
    final ContactListItemView view = super.newView(context, partition, cursor, position, parent);
    view.setSupportVideoCallIcon(mVideoCallingEnabled);
    return view;
}
Also used : ContactListItemView(com.android.contacts.common.list.ContactListItemView)

Example 5 with ContactListItemView

use of com.android.contacts.common.list.ContactListItemView in project android_packages_apps_Dialer by MoKee.

the class DialerPhoneNumberListAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    final int shortcutType = getShortcutTypeFromPosition(position);
    if (shortcutType >= 0) {
        if (convertView != null) {
            assignShortcutToView((ContactListItemView) convertView, shortcutType);
            return convertView;
        } else {
            final ContactListItemView v = new ContactListItemView(getContext(), null, mVideoCallingEnabled);
            assignShortcutToView(v, shortcutType);
            return v;
        }
    } else {
        return super.getView(position, convertView, parent);
    }
}
Also used : ContactListItemView(com.android.contacts.common.list.ContactListItemView)

Aggregations

ContactListItemView (com.android.contacts.common.list.ContactListItemView)19 DuplicatesUtils (com.android.contacts.util.DuplicatesUtils)1 FilteredNumberAsyncQueryHandler (com.android.dialer.blocking.FilteredNumberAsyncQueryHandler)1 FilteredNumberAsyncQueryHandler (com.android.dialer.database.FilteredNumberAsyncQueryHandler)1