mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-09 15:50:00 +00:00
Fix UI issue when sending tx from UTXOs fragment
This commit is contained in:
parent
f7250b5525
commit
967e2bc58c
2 changed files with 16 additions and 2 deletions
|
@ -56,6 +56,7 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment {
|
|||
public LiveData<PendingTransaction> pendingTransaction = _pendingTransaction;
|
||||
public UriData uriData = null;
|
||||
public boolean isChurning = false;
|
||||
public Listener listener = null;
|
||||
public PendingTransaction.Priority priority;
|
||||
private EditText addressEditText;
|
||||
private EditText amountEditText;
|
||||
|
@ -252,6 +253,9 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment {
|
|||
activity.runOnUiThread(() -> {
|
||||
if (success) {
|
||||
Toast.makeText(getActivity(), getString(R.string.sent_tx), Toast.LENGTH_SHORT).show();
|
||||
if(listener != null) {
|
||||
listener.onSentTransaction();
|
||||
}
|
||||
dismiss();
|
||||
} else {
|
||||
sendButton.setEnabled(true);
|
||||
|
@ -337,5 +341,7 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public interface Listener {
|
||||
void onSentTransaction();
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@ import net.mynero.wallet.util.UriData;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
public class UtxosFragment extends Fragment implements CoinsInfoAdapter.CoinsInfoAdapterListener {
|
||||
public class UtxosFragment extends Fragment implements CoinsInfoAdapter.CoinsInfoAdapterListener, SendBottomSheetDialog.Listener {
|
||||
|
||||
private UtxosViewModel mViewModel;
|
||||
private final ArrayList<String> selectedUtxos = new ArrayList<>();
|
||||
|
@ -53,11 +53,13 @@ public class UtxosFragment extends Fragment implements CoinsInfoAdapter.CoinsInf
|
|||
churnUtxosButton.setVisibility(View.GONE);
|
||||
sendUtxosButton.setOnClickListener(view1 -> {
|
||||
SendBottomSheetDialog sendDialog = new SendBottomSheetDialog();
|
||||
sendDialog.listener = this;
|
||||
sendDialog.selectedUtxos = selectedUtxos;
|
||||
sendDialog.show(getActivity().getSupportFragmentManager(), null);
|
||||
});
|
||||
churnUtxosButton.setOnClickListener(view1 -> {
|
||||
SendBottomSheetDialog sendDialog = new SendBottomSheetDialog();
|
||||
sendDialog.listener = this;
|
||||
sendDialog.isChurning = true;
|
||||
sendDialog.uriData = UriData.parse(AddressService.getInstance().currentSubaddress().getAddress());
|
||||
sendDialog.selectedUtxos = selectedUtxos;
|
||||
|
@ -108,4 +110,10 @@ public class UtxosFragment extends Fragment implements CoinsInfoAdapter.CoinsInf
|
|||
|
||||
adapter.updateSelectedUtxos(selectedUtxos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSentTransaction() {
|
||||
churnUtxosButton.setVisibility(View.GONE);
|
||||
sendUtxosButton.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue