mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Set maximum amount of custodians in UI
This commit is contained in:
@@ -86,15 +86,19 @@ public class CustodianSelectorFragment extends ContactSelectorFragment {
|
||||
|
||||
int n = selectedContacts.size();
|
||||
int min = 2;
|
||||
boolean enough = n >= min;
|
||||
int max = 7;
|
||||
boolean amountIsValid = (n >= min) && (n <= max);
|
||||
|
||||
item.setVisible(enough);
|
||||
item.setVisible(amountIsValid);
|
||||
if (n == 0) {
|
||||
Toast.makeText(getContext(), String.format(getString(R.string.select_at_least_n_contacts), min),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
} else if (n < min) {
|
||||
Toast.makeText(getContext(), String.format(getString(R.string.select_at_least_n_more_contacts), min - n),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
} else if (n > max) {
|
||||
Toast.makeText(getContext(), String.format(getString(R.string.select_no_more_than_n_contacts), max),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -657,6 +657,7 @@
|
||||
|
||||
<string name="select_at_least_n_contacts">Please select at least %d contacts</string>
|
||||
<string name="select_at_least_n_more_contacts">Please select at least %d more contacts</string>
|
||||
<string name="select_no_more_than_n_contacts">Too many! Please select no more than %d contacts</string>
|
||||
|
||||
<string name="threshold">Choose the minimum number of trusted contacts needed to restore your account</string>
|
||||
<string name="threshold_disabled">Two trusted contacts will be needed to restore your account</string>
|
||||
|
||||
Reference in New Issue
Block a user