Update and centralize block strings.

This commit is contained in:
Greyson Parrelli
2020-04-16 11:30:51 -04:00
parent 6d6e017c71
commit b3d57edb24
5 changed files with 129 additions and 111 deletions

View File

@@ -688,8 +688,13 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
private class BlockClickedListener implements Preference.OnPreferenceClickListener {
@Override
public boolean onPreferenceClick(Preference preference) {
if (recipient.get().isBlocked()) BlockUnblockDialog.handleUnblock(preference.getContext(), getLifecycle(), recipient.getId(), null);
else BlockUnblockDialog.handleBlock(preference.getContext(), getLifecycle(), recipient.getId());
Context context = preference.getContext();
if (recipient.get().isBlocked()) {
BlockUnblockDialog.showUnblockFor(context, getLifecycle(), recipient.get(), () -> RecipientUtil.unblock(context, recipient.get()));
} else {
BlockUnblockDialog.showBlockFor(context, getLifecycle(), recipient.get(), () -> RecipientUtil.block(context, recipient.get()));
}
return true;
}