Disable add participants in group chat infos if group is not created yet (there is a back button)

This commit is contained in:
Sylvain Berfini 2018-11-09 13:18:23 +01:00
parent f589b33c56
commit a6beb9df07

View file

@ -208,7 +208,7 @@ public class GroupInfoFragment extends Fragment implements ChatRoomListener {
mAddParticipantsLayout.setOnClickListener(new View.OnClickListener() { mAddParticipantsLayout.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
if (mIsEditionEnabled) { if (mIsEditionEnabled && mIsAlreadyCreatedGroup) {
LinphoneActivity.instance().goToChatCreator(mGroupChatRoomAddress != null ? mGroupChatRoomAddress.asString() : null, mParticipants, mSubject, !mIsAlreadyCreatedGroup, null, true, mIsEncryptionEnabled); LinphoneActivity.instance().goToChatCreator(mGroupChatRoomAddress != null ? mGroupChatRoomAddress.asString() : null, mParticipants, mSubject, !mIsAlreadyCreatedGroup, null, true, mIsEncryptionEnabled);
} }
} }
@ -217,9 +217,12 @@ public class GroupInfoFragment extends Fragment implements ChatRoomListener {
mAddParticipantsButton.setOnClickListener(new View.OnClickListener() { mAddParticipantsButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
if (mIsEditionEnabled && mIsAlreadyCreatedGroup) {
LinphoneActivity.instance().goToChatCreator(mGroupChatRoomAddress != null ? mGroupChatRoomAddress.asString() : null, mParticipants, mSubject, !mIsAlreadyCreatedGroup, null, true, mIsEncryptionEnabled); LinphoneActivity.instance().goToChatCreator(mGroupChatRoomAddress != null ? mGroupChatRoomAddress.asString() : null, mParticipants, mSubject, !mIsAlreadyCreatedGroup, null, true, mIsEncryptionEnabled);
} }
}
}); });
mAddParticipantsButton.setVisibility(mIsAlreadyCreatedGroup ? View.VISIBLE : View.GONE);
mSubjectField = view.findViewById(R.id.subjectField); mSubjectField = view.findViewById(R.id.subjectField);
mSubjectField.addTextChangedListener(new TextWatcher() { mSubjectField.addTextChangedListener(new TextWatcher() {