compose: small fixes for alternate recipient adapter
this slightly alters behavior when a non-contact address is picked, to make sure a crypto status is shown in the alternate dropdown.
This commit is contained in:
parent
ecb0044cc4
commit
a2674efff1
2 changed files with 6 additions and 3 deletions
|
@ -49,6 +49,10 @@ public class AlternateRecipientAdapter extends BaseAdapter {
|
|||
|
||||
public void setAlternateRecipientInfo(List<Recipient> recipients) {
|
||||
this.recipients = recipients;
|
||||
int indexOfCurrentRecipient = recipients.indexOf(currentRecipient);
|
||||
if (indexOfCurrentRecipient >= 0) {
|
||||
currentRecipient = recipients.get(indexOfCurrentRecipient);
|
||||
}
|
||||
recipients.remove(currentRecipient);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
|
|
@ -334,8 +334,7 @@ public class RecipientSelectView extends TokenCompleteTextView<Recipient> implem
|
|||
if (contactLookupUri != null) {
|
||||
return new RecipientLoader(getContext(), cryptoProvider, contactLookupUri, true);
|
||||
} else {
|
||||
String address = alternatesPopupRecipient.address.getAddress();
|
||||
return new RecipientLoader(getContext(), cryptoProvider, address);
|
||||
return new RecipientLoader(getContext(), cryptoProvider, alternatesPopupRecipient.address);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -451,7 +450,7 @@ public class RecipientSelectView extends TokenCompleteTextView<Recipient> implem
|
|||
|
||||
RecipientTokenSpan[] recipientSpans = text.getSpans(0, text.length(), RecipientTokenSpan.class);
|
||||
for (RecipientTokenSpan recipientSpan : recipientSpans) {
|
||||
if (recipientSpan.getToken() == currentRecipient) {
|
||||
if (recipientSpan.getToken().equals(currentRecipient)) {
|
||||
return recipientSpan.view;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue