mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-29 17:13:15 +00:00
More conditions to account for
This commit is contained in:
parent
2cc6942e27
commit
ae4a8724e8
1 changed files with 12 additions and 1 deletions
|
@ -202,6 +202,17 @@ public class SendFragment extends Fragment {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean destsHasPaymentId() {
|
||||||
|
List<Pair<String, String>> dests = getRawDests();
|
||||||
|
for(Pair<String, String> dest : dests) {
|
||||||
|
String address = dest.component1();
|
||||||
|
UriData uriData = UriData.parse(address);
|
||||||
|
if(uriData == null) return false;
|
||||||
|
if(uriData.hasPaymentId()) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void bindObservers() {
|
private void bindObservers() {
|
||||||
mViewModel.sendingMax.observe(getViewLifecycleOwner(), sendingMax -> {
|
mViewModel.sendingMax.observe(getViewLifecycleOwner(), sendingMax -> {
|
||||||
if (mViewModel.pendingTransaction.getValue() == null) {
|
if (mViewModel.pendingTransaction.getValue() == null) {
|
||||||
|
@ -216,7 +227,7 @@ public class SendFragment extends Fragment {
|
||||||
});
|
});
|
||||||
|
|
||||||
mViewModel.showAddOutputButton.observe(getViewLifecycleOwner(), show -> {
|
mViewModel.showAddOutputButton.observe(getViewLifecycleOwner(), show -> {
|
||||||
setAddOutputButtonVisibility(show ? View.VISIBLE : View.INVISIBLE);
|
setAddOutputButtonVisibility((show && !destsHasPaymentId()) ? View.VISIBLE : View.INVISIBLE);
|
||||||
});
|
});
|
||||||
|
|
||||||
mViewModel.pendingTransaction.observe(getViewLifecycleOwner(), pendingTx -> {
|
mViewModel.pendingTransaction.observe(getViewLifecycleOwner(), pendingTx -> {
|
||||||
|
|
Loading…
Reference in a new issue