コード例 #1
0
 public GroupMembers(Recipients recipients) {
   for (Recipient recipient : recipients.getRecipientsList()) {
     if (isLocalNumber(recipient)) {
       members.push(recipient);
     } else {
       members.add(recipient);
     }
   }
 }
コード例 #2
0
  private List<PushAddress> getPushAddresses(Recipients recipients) throws InvalidNumberException {
    List<PushAddress> addresses = new LinkedList<>();

    for (Recipient recipient : recipients.getRecipientsList()) {
      addresses.add(getPushAddress(recipient));
    }

    return addresses;
  }
コード例 #3
0
  private void setRecipientsTitle(Recipients recipients) {
    int size = recipients.getRecipientsList().size();

    title.setText(getContext().getString(R.string.ConversationActivity_group_conversation));
    subtitle.setText(
        (size == 1)
            ? getContext().getString(R.string.ConversationActivity_d_recipients_in_group_singular)
            : String.format(
                getContext().getString(R.string.ConversationActivity_d_recipients_in_group), size));
    subtitle.setVisibility(View.VISIBLE);
  }
コード例 #4
0
  private long[] getRecipientIds(Recipients recipients) {
    Set<Long> recipientSet = new HashSet<>();
    List<Recipient> recipientList = recipients.getRecipientsList();

    for (Recipient recipient : recipientList) {
      recipientSet.add(recipient.getRecipientId());
    }

    long[] recipientArray = new long[recipientSet.size()];
    int i = 0;

    for (Long recipientId : recipientSet) {
      recipientArray[i++] = recipientId;
    }

    Arrays.sort(recipientArray);

    return recipientArray;
  }