diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/views/GroupMembershipStatusView.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/views/GroupMembershipStatusView.java index 79de8ba..5ab1685 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/views/GroupMembershipStatusView.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/views/GroupMembershipStatusView.java @@ -9,6 +9,7 @@ import android.view.View; import android.widget.Button; import org.communiquons.android.comunic.client.R; +import org.communiquons.android.comunic.client.data.enums.GroupRegistrationLevel; import org.communiquons.android.comunic.client.data.models.GroupInfo; import org.communiquons.android.comunic.client.ui.listeners.OnGroupMembershipUpdateListener; @@ -31,6 +32,7 @@ public class GroupMembershipStatusView extends BaseFrameLayoutView implements Vi private Button joinButton; private ConstraintLayout memberForm; private Button leaveButton; + private ConstraintLayout closeRegistrationForm; /** * Group information @@ -64,6 +66,7 @@ public class GroupMembershipStatusView extends BaseFrameLayoutView implements Vi joinButton = view.findViewById(R.id.joinButton); memberForm = view.findViewById(R.id.memberForm); leaveButton = view.findViewById(R.id.leaveButton); + closeRegistrationForm = view.findViewById(R.id.closedRegistrationForm); //Show only one form showForm(respondInvitationForm); @@ -95,7 +98,10 @@ public class GroupMembershipStatusView extends BaseFrameLayoutView implements Vi switch (info.getMembershipLevel()) { case VISITOR: - showForm(requestForm); + if(info.getRegistrationLevel() == GroupRegistrationLevel.CLOSED) + showForm(closeRegistrationForm); + else + showForm(requestForm); return; case PENDING: @@ -125,6 +131,8 @@ public class GroupMembershipStatusView extends BaseFrameLayoutView implements Vi requestForm.setVisibility(v.equals(requestForm) ? View.VISIBLE : View.GONE); memberForm.setVisibility(v.equals(memberForm) ? View.VISIBLE : View.GONE); + closeRegistrationForm.setVisibility(v.equals(closeRegistrationForm) + ? View.VISIBLE : View.GONE); } diff --git a/app/src/main/res/layout/view_group_membership_status.xml b/app/src/main/res/layout/view_group_membership_status.xml index eb94f00..ceb1e0a 100644 --- a/app/src/main/res/layout/view_group_membership_status.xml +++ b/app/src/main/res/layout/view_group_membership_status.xml @@ -134,4 +134,28 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dc7a9aa..847868f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -313,4 +313,5 @@ Could not update group membership! Could not get group information! Access to the group denied. + Invitation only