use of eu.siacs.conversations.ui.adapter.MediaAdapter in project Conversations by siacs.
the class ConferenceDetailsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_muc_details);
this.binding.changeConferenceButton.setOnClickListener(this.mChangeConferenceSettings);
setSupportActionBar(binding.toolbar);
configureActionBar(getSupportActionBar());
this.binding.editNickButton.setOnClickListener(v -> quickEdit(mConversation.getMucOptions().getActualNick(), R.string.nickname, value -> {
if (xmppConnectionService.renameInMuc(mConversation, value, renameCallback)) {
return null;
} else {
return getString(R.string.invalid_muc_nick);
}
}));
this.mAdvancedMode = getPreferences().getBoolean("advanced_muc_mode", false);
this.binding.mucInfoMore.setVisibility(this.mAdvancedMode ? View.VISIBLE : View.GONE);
this.binding.notificationStatusButton.setOnClickListener(this.mNotifyStatusClickListener);
this.binding.yourPhoto.setOnClickListener(v -> {
final MucOptions mucOptions = mConversation.getMucOptions();
if (!mucOptions.hasVCards()) {
Toast.makeText(this, R.string.host_does_not_support_group_chat_avatars, Toast.LENGTH_SHORT).show();
return;
}
if (!mucOptions.getSelf().getAffiliation().ranks(MucOptions.Affiliation.OWNER)) {
Toast.makeText(this, R.string.only_the_owner_can_change_group_chat_avatar, Toast.LENGTH_SHORT).show();
return;
}
final Intent intent = new Intent(this, PublishGroupChatProfilePictureActivity.class);
intent.putExtra("uuid", mConversation.getUuid());
startActivity(intent);
});
this.binding.editMucNameButton.setOnClickListener(this::onMucEditButtonClicked);
this.binding.mucEditTitle.addTextChangedListener(this);
this.binding.mucEditSubject.addTextChangedListener(this);
this.binding.mucEditSubject.addTextChangedListener(new StylingHelper.MessageEditorStyler(this.binding.mucEditSubject));
this.mMediaAdapter = new MediaAdapter(this, R.dimen.media_size);
this.mUserPreviewAdapter = new UserPreviewAdapter();
this.binding.media.setAdapter(mMediaAdapter);
this.binding.users.setAdapter(mUserPreviewAdapter);
GridManager.setupLayoutManager(this, this.binding.media, R.dimen.media_size);
GridManager.setupLayoutManager(this, this.binding.users, R.dimen.media_size);
this.binding.invite.setOnClickListener(v -> inviteToConversation(mConversation));
this.binding.showUsers.setOnClickListener(v -> {
Intent intent = new Intent(this, MucUsersActivity.class);
intent.putExtra("uuid", mConversation.getUuid());
startActivity(intent);
});
}
use of eu.siacs.conversations.ui.adapter.MediaAdapter in project Conversations by siacs.
the class MediaBrowserActivity method onCreate.
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_media_browser);
setSupportActionBar(binding.toolbar);
configureActionBar(getSupportActionBar());
mMediaAdapter = new MediaAdapter(this, R.dimen.media_size);
this.binding.media.setAdapter(mMediaAdapter);
GridManager.setupLayoutManager(this, this.binding.media, R.dimen.browser_media_size);
}
use of eu.siacs.conversations.ui.adapter.MediaAdapter in project Conversations by siacs.
the class ContactDetailsActivity method onCreate.
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
showInactiveOmemo = savedInstanceState != null && savedInstanceState.getBoolean("show_inactive_omemo", false);
if (getIntent().getAction().equals(ACTION_VIEW_CONTACT)) {
try {
this.accountJid = Jid.ofEscaped(getIntent().getExtras().getString(EXTRA_ACCOUNT));
} catch (final IllegalArgumentException ignored) {
}
try {
this.contactJid = Jid.ofEscaped(getIntent().getExtras().getString("contact"));
} catch (final IllegalArgumentException ignored) {
}
}
this.messageFingerprint = getIntent().getStringExtra("fingerprint");
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_contact_details);
setSupportActionBar(binding.toolbar);
configureActionBar(getSupportActionBar());
binding.showInactiveDevices.setOnClickListener(v -> {
showInactiveOmemo = !showInactiveOmemo;
populateView();
});
binding.addContactButton.setOnClickListener(v -> showAddToRosterDialog(contact));
mMediaAdapter = new MediaAdapter(this, R.dimen.media_size);
this.binding.media.setAdapter(mMediaAdapter);
GridManager.setupLayoutManager(this, this.binding.media, R.dimen.media_size);
}
Aggregations