Search in sources :

Example 1 with SelectedContact

use of org.thoughtcrime.securesms.contacts.SelectedContact in project Signal-Android by signalapp.

the class PushContactSelectionActivity method onFinishedSelection.

protected final void onFinishedSelection() {
    Intent resultIntent = getIntent();
    List<SelectedContact> selectedContacts = contactsFragment.getSelectedContacts();
    List<RecipientId> recipients = Stream.of(selectedContacts).map(sc -> sc.getOrCreateRecipientId(this)).toList();
    resultIntent.putParcelableArrayListExtra(KEY_SELECTED_RECIPIENTS, new ArrayList<>(recipients));
    setResult(RESULT_OK, resultIntent);
    finish();
}
Also used : Log(org.signal.core.util.logging.Log) List(java.util.List) Bundle(android.os.Bundle) Stream(com.annimon.stream.Stream) RecipientId(org.thoughtcrime.securesms.recipients.RecipientId) SelectedContact(org.thoughtcrime.securesms.contacts.SelectedContact) Intent(android.content.Intent) ArrayList(java.util.ArrayList) RecipientId(org.thoughtcrime.securesms.recipients.RecipientId) Intent(android.content.Intent) SelectedContact(org.thoughtcrime.securesms.contacts.SelectedContact)

Example 2 with SelectedContact

use of org.thoughtcrime.securesms.contacts.SelectedContact in project Signal-Android by WhisperSystems.

the class PushContactSelectionActivity method onFinishedSelection.

protected final void onFinishedSelection() {
    Intent resultIntent = getIntent();
    List<SelectedContact> selectedContacts = contactsFragment.getSelectedContacts();
    List<RecipientId> recipients = Stream.of(selectedContacts).map(sc -> sc.getOrCreateRecipientId(this)).toList();
    resultIntent.putParcelableArrayListExtra(KEY_SELECTED_RECIPIENTS, new ArrayList<>(recipients));
    setResult(RESULT_OK, resultIntent);
    finish();
}
Also used : Log(org.signal.core.util.logging.Log) List(java.util.List) Bundle(android.os.Bundle) Stream(com.annimon.stream.Stream) RecipientId(org.thoughtcrime.securesms.recipients.RecipientId) SelectedContact(org.thoughtcrime.securesms.contacts.SelectedContact) Intent(android.content.Intent) ArrayList(java.util.ArrayList) RecipientId(org.thoughtcrime.securesms.recipients.RecipientId) Intent(android.content.Intent) SelectedContact(org.thoughtcrime.securesms.contacts.SelectedContact)

Aggregations

Intent (android.content.Intent)2 Bundle (android.os.Bundle)2 Stream (com.annimon.stream.Stream)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Log (org.signal.core.util.logging.Log)2 SelectedContact (org.thoughtcrime.securesms.contacts.SelectedContact)2 RecipientId (org.thoughtcrime.securesms.recipients.RecipientId)2