use of org.thoughtcrime.securesms.groups.ui.GroupMemberListView in project Signal-Android by WhisperSystems.
the class NonGv2MemberDialog method showNonGv2Members.
@Nullable
public static Dialog showNonGv2Members(@NonNull Context context, @NonNull LifecycleOwner lifecycleOwner, @NonNull List<Recipient> recipients) {
int size = recipients.size();
if (size == 0) {
return null;
}
AlertDialog.Builder builder = new AlertDialog.Builder(context).setPositiveButton(android.R.string.ok, null);
if (size == 1) {
builder.setMessage(context.getString(R.string.NonGv2MemberDialog_single_users_are_non_gv2_capable_forced_migration, recipients.get(0).getDisplayName(context)));
} else {
builder.setMessage(context.getResources().getQuantityString(R.plurals.NonGv2MemberDialog_d_users_are_non_gv2_capable_forced_migration, size, size)).setView(R.layout.dialog_multiple_members_non_gv2_capable);
}
Dialog dialog = builder.show();
if (size > 1) {
GroupMemberListView nonGv2CapableMembers = dialog.findViewById(R.id.list_non_gv2_members);
nonGv2CapableMembers.initializeAdapter(lifecycleOwner);
List<GroupMemberEntry.NewGroupCandidate> pendingMembers = new ArrayList<>(recipients.size());
for (Recipient r : recipients) {
pendingMembers.add(new GroupMemberEntry.NewGroupCandidate(r));
}
// noinspection ConstantConditions
nonGv2CapableMembers.setMembers(pendingMembers);
}
return dialog;
}
use of org.thoughtcrime.securesms.groups.ui.GroupMemberListView in project Signal-Android by signalapp.
the class NonGv2MemberDialog method showNonGv2Members.
@Nullable
public static Dialog showNonGv2Members(@NonNull Context context, @NonNull LifecycleOwner lifecycleOwner, @NonNull List<Recipient> recipients) {
int size = recipients.size();
if (size == 0) {
return null;
}
AlertDialog.Builder builder = new AlertDialog.Builder(context).setPositiveButton(android.R.string.ok, null);
if (size == 1) {
builder.setMessage(context.getString(R.string.NonGv2MemberDialog_single_users_are_non_gv2_capable_forced_migration, recipients.get(0).getDisplayName(context)));
} else {
builder.setMessage(context.getResources().getQuantityString(R.plurals.NonGv2MemberDialog_d_users_are_non_gv2_capable_forced_migration, size, size)).setView(R.layout.dialog_multiple_members_non_gv2_capable);
}
Dialog dialog = builder.show();
if (size > 1) {
GroupMemberListView nonGv2CapableMembers = dialog.findViewById(R.id.list_non_gv2_members);
nonGv2CapableMembers.initializeAdapter(lifecycleOwner);
List<GroupMemberEntry.NewGroupCandidate> pendingMembers = new ArrayList<>(recipients.size());
for (Recipient r : recipients) {
pendingMembers.add(new GroupMemberEntry.NewGroupCandidate(r));
}
// noinspection ConstantConditions
nonGv2CapableMembers.setMembers(pendingMembers);
}
return dialog;
}
Aggregations