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 LayoutInflater mInflater;
|
||||||
private List<ContactAddress> mItems;
|
private List<ContactAddress> mItems;
|
||||||
private View.OnClickListener mDeleteListener;
|
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;
|
mInflater = inflater;
|
||||||
mItems = items;
|
mItems = items;
|
||||||
mHideAdminFeatures = hideAdminFeatures;
|
mHideAdminFeatures = hideAdminFeatures;
|
||||||
|
mIsCreation = isCreation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -118,6 +119,8 @@ public class GroupInfoAdapter extends BaseAdapter {
|
||||||
if (mHideAdminFeatures) {
|
if (mHideAdminFeatures) {
|
||||||
delete.setVisibility(View.GONE);
|
delete.setVisibility(View.GONE);
|
||||||
adminLayout.setVisibility(View.GONE);
|
adminLayout.setVisibility(View.GONE);
|
||||||
|
} else if (mIsCreation) {
|
||||||
|
adminLayout.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class GroupInfoFragment extends Fragment {
|
||||||
String subject = getArguments().getString("subject");
|
String subject = getArguments().getString("subject");
|
||||||
|
|
||||||
mParticipantsList = view.findViewById(R.id.chat_room_participants);
|
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() {
|
mAdapter.setOnDeleteClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
@ -139,8 +139,6 @@ public class GroupInfoFragment extends Fragment {
|
||||||
mAddParticipantsButton.setVisibility(View.GONE);
|
mAddParticipantsButton.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO Handle back button issue
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue