use of org.thoughtcrime.securesms.contacts.RecipientsAdapter in project Signal-Android by signalapp.
the class PushRecipientsPanel method initRecipientsEditor.
private void initRecipientsEditor() {
this.recipientsText = (RecipientsEditor) findViewById(R.id.recipients_text);
List<Recipient> recipients = getRecipients();
for (Recipient recipient : recipients) {
recipient.addListener(this);
}
recipientsText.setAdapter(new RecipientsAdapter(this.getContext()));
recipientsText.populate(recipients);
recipientsText.setOnFocusChangeListener(new FocusChangedListener());
recipientsText.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
if (panelChangeListener != null) {
panelChangeListener.onRecipientsPanelUpdate(getRecipients());
}
recipientsText.setText("");
}
});
}
use of org.thoughtcrime.securesms.contacts.RecipientsAdapter in project Signal-Android by WhisperSystems.
the class SingleRecipientPanel method initRecipientsEditor.
private void initRecipientsEditor() {
Recipients recipients;
recipientsText = (RecipientsEditor) findViewById(R.id.recipients_text);
try {
recipients = getRecipients();
} catch (RecipientFormattingException e) {
recipients = RecipientFactory.getRecipientsFor(getContext(), new LinkedList<Recipient>(), true);
}
recipients.addListener(this);
recipientsText.setAdapter(new RecipientsAdapter(this.getContext()));
recipientsText.populate(recipients);
recipientsText.setOnFocusChangeListener(new FocusChangedListener());
recipientsText.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
if (panelChangeListener != null) {
try {
panelChangeListener.onRecipientsPanelUpdate(getRecipients());
} catch (RecipientFormattingException rfe) {
panelChangeListener.onRecipientsPanelUpdate(null);
}
}
recipientsText.setText("");
}
});
}
use of org.thoughtcrime.securesms.contacts.RecipientsAdapter in project Signal-Android by WhisperSystems.
the class PushRecipientsPanel method initRecipientsEditor.
private void initRecipientsEditor() {
this.recipientsText = (RecipientsEditor) findViewById(R.id.recipients_text);
List<Recipient> recipients = getRecipients();
Stream.of(recipients).map(Recipient::live).forEach(r -> r.observeForever(this));
recipientsText.setAdapter(new RecipientsAdapter(this.getContext()));
recipientsText.populate(recipients);
recipientsText.setOnFocusChangeListener(new FocusChangedListener());
recipientsText.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
if (panelChangeListener != null) {
panelChangeListener.onRecipientsPanelUpdate(getRecipients());
}
recipientsText.setText("");
}
});
}
Aggregations