From f02d56ef1cea595a912452d04f663eae6732cd3f Mon Sep 17 00:00:00 2001 From: pokkst Date: Sat, 24 Sep 2022 14:10:36 -0500 Subject: [PATCH] Add more information to utxo cell --- app/src/main/cpp/monerujo.cpp | 5 ++-- .../wallet/adapter/CoinsInfoAdapter.java | 8 ++++++- .../net/mynero/wallet/model/CoinsInfo.java | 8 ++++++- .../main/res/layout/utxo_selection_item.xml | 24 +++++++++++++++++++ app/src/main/res/values/strings.xml | 2 ++ 5 files changed, 43 insertions(+), 4 deletions(-) diff --git a/app/src/main/cpp/monerujo.cpp b/app/src/main/cpp/monerujo.cpp index 1fafbd9..eb3bb68 100644 --- a/app/src/main/cpp/monerujo.cpp +++ b/app/src/main/cpp/monerujo.cpp @@ -1124,7 +1124,7 @@ Java_net_mynero_wallet_model_Wallet_getCoinsJ(JNIEnv *env, jobject instance) { jobject newCoinsInfo(JNIEnv *env, Monero::CoinsInfo *info) { jmethodID c = env->GetMethodID(class_CoinsInfo, "", - "(JZLjava/lang/String;JLjava/lang/String;Ljava/lang/String;Z)V"); + "(JZLjava/lang/String;JLjava/lang/String;Ljava/lang/String;ZJ)V"); jstring _key_image = env->NewStringUTF(info->keyImage().c_str()); jstring _pub_key = env->NewStringUTF(info->pubKey().c_str()); jstring _hash = env->NewStringUTF(info->hash().c_str()); @@ -1135,7 +1135,8 @@ jobject newCoinsInfo(JNIEnv *env, Monero::CoinsInfo *info) { static_cast (info->amount()), _hash, _pub_key, - info->unlocked()); + info->unlocked(), + static_cast (info->internalOutputIndex())); env->DeleteLocalRef(_key_image); env->DeleteLocalRef(_hash); env->DeleteLocalRef(_pub_key); diff --git a/app/src/main/java/net/mynero/wallet/adapter/CoinsInfoAdapter.java b/app/src/main/java/net/mynero/wallet/adapter/CoinsInfoAdapter.java index 8fb6ec1..b4e993c 100644 --- a/app/src/main/java/net/mynero/wallet/adapter/CoinsInfoAdapter.java +++ b/app/src/main/java/net/mynero/wallet/adapter/CoinsInfoAdapter.java @@ -100,8 +100,14 @@ public class CoinsInfoAdapter extends RecyclerView.Adapter { boolean unlocked = coinsInfo.isUnlocked(); if(unlocked) { diff --git a/app/src/main/java/net/mynero/wallet/model/CoinsInfo.java b/app/src/main/java/net/mynero/wallet/model/CoinsInfo.java index cf47594..b4c6e83 100644 --- a/app/src/main/java/net/mynero/wallet/model/CoinsInfo.java +++ b/app/src/main/java/net/mynero/wallet/model/CoinsInfo.java @@ -36,8 +36,9 @@ public class CoinsInfo implements Parcelable, Comparable { String hash; String pubKey; boolean unlocked; + long localOutputIndex; - public CoinsInfo(long globalOutputIndex, boolean spent, String keyImage, long amount, String hash, String pubKey, boolean unlocked) { + public CoinsInfo(long globalOutputIndex, boolean spent, String keyImage, long amount, String hash, String pubKey, boolean unlocked, long localOutputIndex) { this.globalOutputIndex = globalOutputIndex; this.spent = spent; this.keyImage = keyImage; @@ -45,6 +46,7 @@ public class CoinsInfo implements Parcelable, Comparable { this.hash = hash; this.pubKey = pubKey; this.unlocked = unlocked; + this.localOutputIndex = localOutputIndex; } protected CoinsInfo(Parcel in) { @@ -91,6 +93,10 @@ public class CoinsInfo implements Parcelable, Comparable { return unlocked; } + public long getLocalOutputIndex() { + return localOutputIndex; + } + @Override public int describeContents() { return 0; diff --git a/app/src/main/res/layout/utxo_selection_item.xml b/app/src/main/res/layout/utxo_selection_item.xml index 5185636..089f271 100644 --- a/app/src/main/res/layout/utxo_selection_item.xml +++ b/app/src/main/res/layout/utxo_selection_item.xml @@ -22,8 +22,32 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:text="Amount" + android:textStyle="bold" android:ellipsize="middle" app:layout_constraintTop_toBottomOf="@id/utxo_pub_key_textview" + app:layout_constraintBottom_toTopOf="@id/utxo_outpoint_textview" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toStartOf="@id/utxo_global_index_textview" + android:singleLine="true" /> + + High View UTXOs Selected value: %1$s XMR + Global Idx: %1$d + Outpoint: %1$s