Do not show admin buttons when creating a group chat room
This commit is contained in:
parent
bece218349
commit
059ad22044
2 changed files with 6 additions and 5 deletions
|
@ -40,12 +40,13 @@ public class GroupInfoAdapter extends BaseAdapter {
|
|||
private LayoutInflater mInflater;
|
||||
private List<ContactAddress> mItems;
|
||||
private View.OnClickListener mDeleteListener;
|
||||
private boolean mHideAdminFeatures;
|
||||
private boolean mHideAdminFeatures, mIsCreation;
|
||||
|
||||
public GroupInfoAdapter(LayoutInflater inflater, List<ContactAddress> items, boolean hideAdminFeatures) {
|
||||
public GroupInfoAdapter(LayoutInflater inflater, List<ContactAddress> items, boolean hideAdminFeatures, boolean isCreation) {
|
||||
mInflater = inflater;
|
||||
mItems = items;
|
||||
mHideAdminFeatures = hideAdminFeatures;
|
||||
mIsCreation = isCreation;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -118,6 +119,8 @@ public class GroupInfoAdapter extends BaseAdapter {
|
|||
if (mHideAdminFeatures) {
|
||||
delete.setVisibility(View.GONE);
|
||||
adminLayout.setVisibility(View.GONE);
|
||||
} else if (mIsCreation) {
|
||||
adminLayout.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
return view;
|
||||
|
|
|
@ -62,7 +62,7 @@ public class GroupInfoFragment extends Fragment {
|
|||
String subject = getArguments().getString("subject");
|
||||
|
||||
mParticipantsList = view.findViewById(R.id.chat_room_participants);
|
||||
mAdapter = new GroupInfoAdapter(mInflater, mParticipants, !mIsEditionEnabled);
|
||||
mAdapter = new GroupInfoAdapter(mInflater, mParticipants, !mIsEditionEnabled, !mIsAlreadyCreatedGroup);
|
||||
mAdapter.setOnDeleteClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
@ -139,8 +139,6 @@ public class GroupInfoFragment extends Fragment {
|
|||
mAddParticipantsButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
//TODO Handle back button issue
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue