mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2024-11-10 05:03:26 +01:00
Add block height to tx details view
This commit is contained in:
parent
1b4008cc65
commit
119ccd67bb
@ -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 -> {
|
||||
|
@ -86,6 +86,32 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/transaction_conf_label_textview"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transaction_block_height_label_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/block_height"
|
||||
android:textSize="18sp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/transaction_conf_textview"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tx_block_height_textview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="middle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/transaction_block_height_label_textview"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transaction_amount_label_textview"
|
||||
android:layout_width="match_parent"
|
||||
@ -96,7 +122,7 @@
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/transaction_conf_textview"/>
|
||||
app:layout_constraintTop_toBottomOf="@id/tx_block_height_textview"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/transaction_amount_textview"
|
||||
|
@ -111,4 +111,5 @@
|
||||
<string name="wallet_viewkey_label">Private view-key</string>
|
||||
<string name="wallet_viewkey_desc">Anyone with your private view-key can see all incoming transactions!</string>
|
||||
<string name="wallet_restore_height_label">Restore height</string>
|
||||
<string name="block_height">Block Height</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user