use of eu.siacs.conversations.ui.adapter.UserPreviewAdapter 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);
});
}
Aggregations