[android] Set handshake link when received via sharing intent or link click

This commit is contained in:
Torsten Grote
2019-05-03 10:18:47 -03:00
parent bec1f117ba
commit d17331b578
2 changed files with 9 additions and 0 deletions

View File

@@ -68,6 +68,11 @@ public class AddContactViewModel extends AndroidViewModel {
return handshakeLink;
}
@Nullable
String getRemoteHandshakeLink() {
return remoteHandshakeLink;
}
void setRemoteHandshakeLink(String link) {
remoteHandshakeLink = link;
}

View File

@@ -72,6 +72,10 @@ public class LinkExchangeFragment extends BaseFragment {
linkInputLayout = v.findViewById(R.id.linkInputLayout);
linkInput = v.findViewById(R.id.linkInput);
if (viewModel.getRemoteHandshakeLink() != null) {
// This can happen if the link was set via an incoming Intent
linkInput.setText(viewModel.getRemoteHandshakeLink());
}
clipboard = (ClipboardManager) requireNonNull(
getContext().getSystemService(CLIPBOARD_SERVICE));