Java 类android.provider.Contacts.Intents 实例源码

项目:TextSecure    文件:ConversationListItem.java   
private void setContactPhoto(final Recipient recipient) {
  if (recipient == null) return;

  contactPhotoImage.setImageBitmap(recipient.getCircleCroppedContactPhoto());

  if (!recipient.isGroupRecipient()) {
    contactPhotoImage.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        if (recipient.getContactUri() != null) {
          QuickContact.showQuickContact(context, contactPhotoImage, recipient.getContactUri(), QuickContact.MODE_LARGE, null);
        } else {
          Intent intent = new Intent(Intents.SHOW_OR_CREATE_CONTACT,  Uri.fromParts("tel", recipient.getNumber(), null));
          context.startActivity(intent);
        }
      }
    });
  } else {
    contactPhotoImage.setOnClickListener(null);
  }
}
项目:Securecom-Messaging    文件:ConversationItem.java   
private void setContactPhotoForRecipient(final Recipient recipient) {
  if (contactPhoto == null) return;

  contactPhoto.setImageBitmap(recipient.getCircleCroppedContactPhoto());

  contactPhoto.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      if (recipient.getContactUri() != null) {
        QuickContact.showQuickContact(context, contactPhoto, recipient.getContactUri(), QuickContact.MODE_LARGE, null);
      } else {
        Intent intent = new Intent(Intents.SHOW_OR_CREATE_CONTACT, Uri.fromParts("tel", recipient.getNumber(), null));
        context.startActivity(intent);
      }
    }
  });

  contactPhoto.setVisibility(View.VISIBLE);
}
项目:Securecom-Messaging    文件:ConversationListItem.java   
private void setContactPhoto(final Recipient recipient) {
  if (recipient == null) return;

  contactPhotoImage.setImageBitmap(recipient.getCircleCroppedContactPhoto());

  if (!recipient.isGroupRecipient()) {
    contactPhotoImage.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        if (recipient.getContactUri() != null) {
          QuickContact.showQuickContact(context, contactPhotoImage, recipient.getContactUri(), QuickContact.MODE_LARGE, null);
        } else {
          Intent intent = new Intent(Intents.SHOW_OR_CREATE_CONTACT,  Uri.fromParts("tel", recipient.getNumber(), null));
          context.startActivity(intent);
        }
      }
    });
  } else {
    contactPhotoImage.setOnClickListener(null);
  }
}
项目:Securecom-Text    文件:ConversationItem.java   
private void setContactPhotoForRecipient(final Recipient recipient) {
  if (contactPhoto == null) return;

  contactPhoto.setImageBitmap(recipient.getCircleCroppedContactPhoto());

  contactPhoto.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      if (recipient.getContactUri() != null) {
        QuickContact.showQuickContact(context, contactPhoto, recipient.getContactUri(), QuickContact.MODE_LARGE, null);
      } else {
        Intent intent = new Intent(Intents.SHOW_OR_CREATE_CONTACT, Uri.fromParts("tel", recipient.getNumber(), null));
        context.startActivity(intent);
      }
    }
  });

  contactPhoto.setVisibility(View.VISIBLE);
}
项目:Securecom-Text    文件:ConversationListItem.java   
private void setContactPhoto(final Recipient recipient) {
  if (recipient == null) return;

  contactPhotoImage.setImageBitmap(recipient.getCircleCroppedContactPhoto());

  if (!recipient.isGroupRecipient()) {
    contactPhotoImage.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        if (recipient.getContactUri() != null) {
          QuickContact.showQuickContact(context, contactPhotoImage, recipient.getContactUri(), QuickContact.MODE_LARGE, null);
        } else {
          Intent intent = new Intent(Intents.SHOW_OR_CREATE_CONTACT,  Uri.fromParts("tel", recipient.getNumber(), null));
          context.startActivity(intent);
        }
      }
    });
  } else {
    contactPhotoImage.setOnClickListener(null);
  }
}
项目:CSipSimple    文件:ContactsUtils3.java   
@Override
public Intent getAddContactIntent(String displayName, String csipUri) {

    Intent intent = new Intent(Intents.Insert.ACTION);

    if(!TextUtils.isEmpty(displayName)) {
        intent.putExtra(Intents.Insert.NAME, displayName);
    }
    intent.putExtra(Intents.Insert.IM_HANDLE, csipUri);
    intent.putExtra(Intents.Insert.IM_PROTOCOL, SipManager.PROTOCOL_CSIP);
    return intent;
}
项目:TextSecure    文件:ConversationItem.java   
private void setContactPhotoForRecipient(final Recipient recipient) {
  if (contactPhoto == null) return;

  Bitmap contactPhotoBitmap;

  if ((recipient.getContactPhoto() == ContactPhotoFactory.getDefaultContactPhoto(context)) && (groupThread)) {
    contactPhotoBitmap = recipient.getGeneratedAvatar(context);
  } else {
    contactPhotoBitmap = recipient.getCircleCroppedContactPhoto();
  }

  contactPhoto.setImageBitmap(contactPhotoBitmap);

  contactPhoto.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      if (recipient.getContactUri() != null) {
        QuickContact.showQuickContact(context, contactPhoto, recipient.getContactUri(), QuickContact.MODE_LARGE, null);
      } else {
        final Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
        intent.putExtra(ContactsContract.Intents.Insert.PHONE, recipient.getNumber());
        intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
        context.startActivity(intent);
      }
    }
  });

  contactPhoto.setVisibility(View.VISIBLE);
}