use of org.thoughtcrime.securesms.recipients.Recipient.RecipientModifiedListener in project Signal-Android by WhisperSystems.
the class MediaOverviewActivity method initializeResources.
private void initializeResources() {
threadId = getIntent().getLongExtra(THREAD_ID_EXTRA, -1);
noImages = (TextView) findViewById(R.id.no_images);
gridView = (RecyclerView) findViewById(R.id.media_grid);
gridManager = new GridLayoutManager(this, getResources().getInteger(R.integer.media_overview_cols));
gridView.setLayoutManager(gridManager);
gridView.setHasFixedSize(true);
final long recipientId = getIntent().getLongExtra(RECIPIENT_EXTRA, -1);
if (recipientId > -1) {
recipient = RecipientFactory.getRecipientForId(this, recipientId, true);
} else if (threadId > -1) {
recipient = DatabaseFactory.getThreadDatabase(this).getRecipientsForThreadId(threadId).getPrimaryRecipient();
} else {
recipient = null;
}
if (recipient != null) {
recipient.addListener(new RecipientModifiedListener() {
@Override
public void onModified(Recipient recipient) {
initializeActionBar();
}
});
}
}
Aggregations