mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 11:51:10 +01:00
Various groups V2 dialog copy changes.
This commit is contained in:
@@ -74,12 +74,6 @@ final class RecipientDialogRepository {
|
||||
});
|
||||
}
|
||||
|
||||
void getGroupName(@NonNull Consumer<String> stringConsumer) {
|
||||
SimpleTask.run(SignalExecutors.BOUNDED,
|
||||
() -> DatabaseFactory.getGroupDatabase(context).requireGroup(Objects.requireNonNull(groupId)).getTitle(),
|
||||
stringConsumer::accept);
|
||||
}
|
||||
|
||||
void removeMember(@NonNull Consumer<Boolean> onComplete, @NonNull GroupChangeErrorCallback error) {
|
||||
SimpleTask.run(SignalExecutors.UNBOUNDED,
|
||||
() -> {
|
||||
|
||||
@@ -178,22 +178,21 @@ final class RecipientDialogViewModel extends ViewModel {
|
||||
}
|
||||
|
||||
void onRemoveFromGroupClicked(@NonNull Activity activity, @NonNull Runnable onSuccess) {
|
||||
recipientDialogRepository.getGroupName(title ->
|
||||
new AlertDialog.Builder(activity)
|
||||
.setMessage(context.getString(R.string.RecipientBottomSheet_remove_s_from_s, Objects.requireNonNull(recipient.getValue()).getDisplayName(context), title))
|
||||
.setPositiveButton(R.string.RecipientBottomSheet_remove,
|
||||
(dialog, which) -> {
|
||||
adminActionBusy.setValue(true);
|
||||
recipientDialogRepository.removeMember(result -> {
|
||||
adminActionBusy.setValue(false);
|
||||
if (result) {
|
||||
onSuccess.run();
|
||||
}
|
||||
},
|
||||
this::showErrorToast);
|
||||
})
|
||||
.setNegativeButton(android.R.string.cancel, (dialog, which) -> {})
|
||||
.show());
|
||||
new AlertDialog.Builder(activity)
|
||||
.setMessage(context.getString(R.string.RecipientBottomSheet_remove_s_from_the_group, Objects.requireNonNull(recipient.getValue()).getDisplayName(context)))
|
||||
.setPositiveButton(R.string.RecipientBottomSheet_remove,
|
||||
(dialog, which) -> {
|
||||
adminActionBusy.setValue(true);
|
||||
recipientDialogRepository.removeMember(result -> {
|
||||
adminActionBusy.setValue(false);
|
||||
if (result) {
|
||||
onSuccess.run();
|
||||
}
|
||||
},
|
||||
this::showErrorToast);
|
||||
})
|
||||
.setNegativeButton(android.R.string.cancel, (dialog, which) -> {})
|
||||
.show();
|
||||
}
|
||||
|
||||
void onAddedToContacts() {
|
||||
|
||||
Reference in New Issue
Block a user