Show pending count and allow view of zero pending screen.
parent
82ba7e2b8b
commit
4cda267f3b
|
@ -62,7 +62,8 @@ public class ManageGroupFragment extends Fragment {
|
|||
|
||||
private ManageGroupViewModel viewModel;
|
||||
private GroupMemberListView groupMemberList;
|
||||
private View listPending;
|
||||
private View pendingMembersRow;
|
||||
private TextView pendingMembersCount;
|
||||
private Toolbar toolbar;
|
||||
private TextView memberCountUnderAvatar;
|
||||
private TextView memberCountAboveList;
|
||||
|
@ -124,7 +125,8 @@ public class ManageGroupFragment extends Fragment {
|
|||
memberCountUnderAvatar = view.findViewById(R.id.member_count);
|
||||
memberCountAboveList = view.findViewById(R.id.member_count_2);
|
||||
groupMemberList = view.findViewById(R.id.group_members);
|
||||
listPending = view.findViewById(R.id.listPending);
|
||||
pendingMembersRow = view.findViewById(R.id.pending_members_row);
|
||||
pendingMembersCount = view.findViewById(R.id.pending_members_count);
|
||||
threadPhotoRailView = view.findViewById(R.id.recent_photos);
|
||||
groupMediaCard = view.findViewById(R.id.group_media_card);
|
||||
accessControlCard = view.findViewById(R.id.group_access_control_card);
|
||||
|
@ -171,16 +173,15 @@ public class ManageGroupFragment extends Fragment {
|
|||
});
|
||||
|
||||
viewModel.getPendingMemberCount().observe(getViewLifecycleOwner(),
|
||||
members -> {
|
||||
if (members > 0) {
|
||||
listPending.setEnabled(true);
|
||||
listPending.setOnClickListener(v -> {
|
||||
FragmentActivity activity = requireActivity();
|
||||
activity.startActivity(PendingMemberInvitesActivity.newIntent(activity, groupId.requireV2()));
|
||||
});
|
||||
pendingInviteCount -> {
|
||||
pendingMembersRow.setOnClickListener(v -> {
|
||||
FragmentActivity activity = requireActivity();
|
||||
activity.startActivity(PendingMemberInvitesActivity.newIntent(activity, groupId.requireV2()));
|
||||
});
|
||||
if (pendingInviteCount == 0) {
|
||||
pendingMembersCount.setText(R.string.ManageGroupActivity_none);
|
||||
} else {
|
||||
listPending.setEnabled(false);
|
||||
listPending.setOnClickListener(null);
|
||||
pendingMembersCount.setText(getResources().getQuantityString(R.plurals.ManageGroupActivity_invited, pendingInviteCount, pendingInviteCount));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -403,12 +403,34 @@
|
|||
app:cardBackgroundColor="?android:attr/windowBackground"
|
||||
app:layout_constraintTop_toBottomOf="@id/group_membership_card">
|
||||
|
||||
<Button
|
||||
android:id="@+id/listPending"
|
||||
style="@style/Widget.Signal.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ManageGroupActivity_pending_group_invites" />
|
||||
<LinearLayout
|
||||
android:id="@+id/pending_members_row"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/group_manage_fragment_row_height"
|
||||
android:background="?selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/group_manage_fragment_row_horizontal_padding"
|
||||
android:paddingEnd="@dimen/group_manage_fragment_row_horizontal_padding">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical|start"
|
||||
android:text="@string/ManageGroupActivity_pending_group_invites"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pending_members_count"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical|end"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||
android:textColor="@color/ultramarine_text_button"
|
||||
tools:text="@string/ManageGroupActivity_none" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
|
|
@ -516,6 +516,11 @@
|
|||
<string name="ManageGroupActivity_add_members">Add members</string>
|
||||
<string name="ManageGroupActivity_view_all_members">View all members</string>
|
||||
|
||||
<string name="ManageGroupActivity_none">None</string>
|
||||
<plurals name="ManageGroupActivity_invited">
|
||||
<item quantity="other">%d invited</item>
|
||||
</plurals>
|
||||
|
||||
<string name="ManageGroupActivity_you_dont_have_the_rights_to_do_this">You don\'t have the rights to do this</string>
|
||||
<string name="ManageGroupActivity_not_capable">Someone you added does not support new groups and needs to update Signal</string>
|
||||
<string name="ManageGroupActivity_failed_to_update_the_group">Failed to update the group</string>
|
||||
|
|
Loading…
Reference in New Issue