Various groups V2 dialog copy changes.

This commit is contained in:
Alan Evans
2020-09-29 12:03:32 -03:00
parent 4e25e8aaa2
commit fe33ce3413
8 changed files with 48 additions and 76 deletions

View File

@@ -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,
() -> {

View File

@@ -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() {