From 119ccd67bb0c3ad0c4048cffe7d28a6c579222be Mon Sep 17 00:00:00 2001 From: pokkst Date: Thu, 13 Oct 2022 19:28:36 -0500 Subject: [PATCH] Add block height to tx details view --- .../transaction/TransactionFragment.java | 10 +++++++ .../main/res/layout/fragment_transaction.xml | 28 ++++++++++++++++++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/mynero/wallet/fragment/transaction/TransactionFragment.java b/app/src/main/java/net/mynero/wallet/fragment/transaction/TransactionFragment.java index bad3905..fd72299 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/transaction/TransactionFragment.java +++ b/app/src/main/java/net/mynero/wallet/fragment/transaction/TransactionFragment.java @@ -80,12 +80,22 @@ public class TransactionFragment extends Fragment { ImageButton copyTxAddressImageButton = view.findViewById(R.id.copy_txaddress_imagebutton); TextView txDateTextView = view.findViewById(R.id.transaction_date_textview); TextView txAmountTextView = view.findViewById(R.id.transaction_amount_textview); + TextView blockHeightTextView = view.findViewById(R.id.tx_block_height_textview); + TextView blockHeightLabelTextView = view.findViewById(R.id.transaction_block_height_label_textview); mViewModel.transaction.observe(getViewLifecycleOwner(), transactionInfo -> { txHashTextView.setText(transactionInfo.hash); txConfTextView.setText("" + transactionInfo.confirmations); txDateTextView.setText(getDateTime(transactionInfo.timestamp)); txAmountTextView.setText(getResources().getString(R.string.tx_amount_no_prefix, Helper.getDisplayAmount(transactionInfo.amount))); + if(transactionInfo.confirmations > 0) { + blockHeightTextView.setText("" + transactionInfo.blockheight); + blockHeightTextView.setVisibility(View.VISIBLE); + blockHeightLabelTextView.setVisibility(View.VISIBLE); + } else { + blockHeightTextView.setVisibility(View.GONE); + blockHeightLabelTextView.setVisibility(View.GONE); + } }); mViewModel.destination.observe(getViewLifecycleOwner(), s -> { diff --git a/app/src/main/res/layout/fragment_transaction.xml b/app/src/main/res/layout/fragment_transaction.xml index 53a0e2f..27056a2 100644 --- a/app/src/main/res/layout/fragment_transaction.xml +++ b/app/src/main/res/layout/fragment_transaction.xml @@ -86,6 +86,32 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/transaction_conf_label_textview"/> + + + + + app:layout_constraintTop_toBottomOf="@id/tx_block_height_textview"/> Private view-key Anyone with your private view-key can see all incoming transactions! Restore height + Block Height