mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2024-11-25 17:02:28 +00:00
Finalize UTXO cell layout (0.4.4.5, ready for release)
This commit is contained in:
parent
3545b0ded6
commit
f5cf9a24e5
9 changed files with 255 additions and 207 deletions
|
@ -9,8 +9,8 @@ android {
|
||||||
applicationId "net.mynero.wallet"
|
applicationId "net.mynero.wallet"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 34
|
targetSdkVersion 34
|
||||||
versionCode 40404
|
versionCode 40405
|
||||||
versionName "0.4.4.4 'Fluorine Fermi'"
|
versionName "0.4.4.5 'Fluorine Fermi'"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
|
|
|
@ -1135,10 +1135,11 @@ Java_net_mynero_wallet_model_Wallet_getCoinsJ(JNIEnv *env, jobject instance) {
|
||||||
|
|
||||||
jobject newCoinsInfo(JNIEnv *env, Monero::CoinsInfo *info) {
|
jobject newCoinsInfo(JNIEnv *env, Monero::CoinsInfo *info) {
|
||||||
jmethodID c = env->GetMethodID(class_CoinsInfo, "<init>",
|
jmethodID c = env->GetMethodID(class_CoinsInfo, "<init>",
|
||||||
"(JZLjava/lang/String;JLjava/lang/String;Ljava/lang/String;ZJZ)V");
|
"(JZLjava/lang/String;JLjava/lang/String;Ljava/lang/String;ZJZLjava/lang/String;)V");
|
||||||
jstring _key_image = env->NewStringUTF(info->keyImage().c_str());
|
jstring _key_image = env->NewStringUTF(info->keyImage().c_str());
|
||||||
jstring _pub_key = env->NewStringUTF(info->pubKey().c_str());
|
jstring _pub_key = env->NewStringUTF(info->pubKey().c_str());
|
||||||
jstring _hash = env->NewStringUTF(info->hash().c_str());
|
jstring _hash = env->NewStringUTF(info->hash().c_str());
|
||||||
|
jstring _address = env->NewStringUTF(info->address().c_str());
|
||||||
jobject result = env->NewObject(class_CoinsInfo, c,
|
jobject result = env->NewObject(class_CoinsInfo, c,
|
||||||
static_cast<jlong> (info->globalOutputIndex()),
|
static_cast<jlong> (info->globalOutputIndex()),
|
||||||
info->spent(),
|
info->spent(),
|
||||||
|
@ -1148,10 +1149,12 @@ jobject newCoinsInfo(JNIEnv *env, Monero::CoinsInfo *info) {
|
||||||
_pub_key,
|
_pub_key,
|
||||||
info->unlocked(),
|
info->unlocked(),
|
||||||
static_cast<jlong> (info->internalOutputIndex()),
|
static_cast<jlong> (info->internalOutputIndex()),
|
||||||
info->frozen());
|
info->frozen(),
|
||||||
|
_address);
|
||||||
env->DeleteLocalRef(_key_image);
|
env->DeleteLocalRef(_key_image);
|
||||||
env->DeleteLocalRef(_hash);
|
env->DeleteLocalRef(_hash);
|
||||||
env->DeleteLocalRef(_pub_key);
|
env->DeleteLocalRef(_pub_key);
|
||||||
|
env->DeleteLocalRef(_address);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,22 +138,24 @@ public class CoinsInfoAdapter extends RecyclerView.Adapter<CoinsInfoAdapter.View
|
||||||
|
|
||||||
TextView pubKeyTextView = itemView.findViewById(R.id.utxo_pub_key_textview);
|
TextView pubKeyTextView = itemView.findViewById(R.id.utxo_pub_key_textview);
|
||||||
TextView amountTextView = itemView.findViewById(R.id.utxo_amount_textview);
|
TextView amountTextView = itemView.findViewById(R.id.utxo_amount_textview);
|
||||||
|
TextView addressTextView = itemView.findViewById(R.id.utxo_address_textview);
|
||||||
TextView globalIdxTextView = itemView.findViewById(R.id.utxo_global_index_textview);
|
TextView globalIdxTextView = itemView.findViewById(R.id.utxo_global_index_textview);
|
||||||
TextView outpointTextView = itemView.findViewById(R.id.utxo_outpoint_textview);
|
TextView outpointTextView = itemView.findViewById(R.id.utxo_outpoint_textview);
|
||||||
boolean streetModeEnabled = PrefService.getInstance().getBoolean(Constants.PREF_STREET_MODE, false);
|
boolean streetModeEnabled = PrefService.getInstance().getBoolean(Constants.PREF_STREET_MODE, false);
|
||||||
String balanceString = streetModeEnabled ? Constants.STREET_MODE_BALANCE : Wallet.getDisplayAmount(coinsInfo.getAmount());
|
String balanceString = streetModeEnabled ? Constants.STREET_MODE_BALANCE : Wallet.getDisplayAmount(coinsInfo.getAmount());
|
||||||
amountTextView.setText(itemView.getResources().getString(R.string.tx_amount_no_prefix, balanceString));
|
amountTextView.setText(itemView.getResources().getString(R.string.tx_amount_no_prefix, balanceString));
|
||||||
pubKeyTextView.setText(coinsInfo.getPubKey());
|
pubKeyTextView.setText(coinsInfo.getPubKey());
|
||||||
|
addressTextView.setText(coinsInfo.getAddress());
|
||||||
globalIdxTextView.setText(itemView.getResources().getString(R.string.global_index_text, coinsInfo.getGlobalOutputIndex()));
|
globalIdxTextView.setText(itemView.getResources().getString(R.string.global_index_text, coinsInfo.getGlobalOutputIndex()));
|
||||||
outpointTextView.setText(itemView.getResources().getString(R.string.outpoint_text, coinsInfo.getHash() + ":" + coinsInfo.getLocalOutputIndex()));
|
outpointTextView.setText(itemView.getResources().getString(R.string.outpoint_text, coinsInfo.getHash() + ":" + coinsInfo.getLocalOutputIndex()));
|
||||||
if (selected) {
|
if (selected) {
|
||||||
itemView.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.oled_colorSecondary));
|
itemView.setBackgroundTintList(ContextCompat.getColorStateList(itemView.getContext(), R.color.oled_colorSecondary));
|
||||||
} else if(coinsInfo.isFrozen()) {
|
} else if(coinsInfo.isFrozen()) {
|
||||||
itemView.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.oled_frozen_utxo));
|
itemView.setBackgroundTintList(ContextCompat.getColorStateList(itemView.getContext(), R.color.oled_frozen_utxo));
|
||||||
} else if (!coinsInfo.isUnlocked()) {
|
} else if (!coinsInfo.isUnlocked()) {
|
||||||
itemView.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.oled_locked_utxo));
|
itemView.setBackgroundTintList(ContextCompat.getColorStateList(itemView.getContext(), R.color.oled_locked_utxo));
|
||||||
} else {
|
} else {
|
||||||
itemView.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), android.R.color.transparent));
|
itemView.setBackgroundTintList(ContextCompat.getColorStateList(itemView.getContext(), R.color.oled_dialogBackgroundColor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,9 @@ public class CoinsInfo implements Parcelable, Comparable<CoinsInfo> {
|
||||||
boolean unlocked;
|
boolean unlocked;
|
||||||
long localOutputIndex;
|
long localOutputIndex;
|
||||||
boolean frozen;
|
boolean frozen;
|
||||||
|
String address;
|
||||||
|
|
||||||
public CoinsInfo(long globalOutputIndex, boolean spent, String keyImage, long amount, String hash, String pubKey, boolean unlocked, long localOutputIndex, boolean frozen) {
|
public CoinsInfo(long globalOutputIndex, boolean spent, String keyImage, long amount, String hash, String pubKey, boolean unlocked, long localOutputIndex, boolean frozen, String address) {
|
||||||
this.globalOutputIndex = globalOutputIndex;
|
this.globalOutputIndex = globalOutputIndex;
|
||||||
this.spent = spent;
|
this.spent = spent;
|
||||||
this.keyImage = keyImage;
|
this.keyImage = keyImage;
|
||||||
|
@ -58,6 +59,7 @@ public class CoinsInfo implements Parcelable, Comparable<CoinsInfo> {
|
||||||
this.unlocked = unlocked;
|
this.unlocked = unlocked;
|
||||||
this.localOutputIndex = localOutputIndex;
|
this.localOutputIndex = localOutputIndex;
|
||||||
this.frozen = frozen;
|
this.frozen = frozen;
|
||||||
|
this.address = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CoinsInfo(Parcel in) {
|
protected CoinsInfo(Parcel in) {
|
||||||
|
@ -100,6 +102,10 @@ public class CoinsInfo implements Parcelable, Comparable<CoinsInfo> {
|
||||||
return frozen;
|
return frozen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int describeContents() {
|
public int describeContents() {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 452 KiB After Width: | Height: | Size: 330 KiB |
Binary file not shown.
Before Width: | Height: | Size: 447 KiB After Width: | Height: | Size: 240 KiB |
Binary file not shown.
Before Width: | Height: | Size: 536 KiB After Width: | Height: | Size: 392 KiB |
|
@ -3,16 +3,22 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:paddingEnd="24dp"
|
|
||||||
android:paddingStart="24dp"
|
|
||||||
android:paddingTop="24dp">
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:scaleType="fitEnd"
|
android:scaleType="fitEnd"
|
||||||
android:src="@drawable/xmrchan_half"
|
android:src="@drawable/xmrchan_half"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:paddingEnd="24dp"
|
||||||
|
android:paddingStart="24dp"
|
||||||
|
android:paddingTop="24dp">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/create_wallet_textview"
|
android:id="@+id/create_wallet_textview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -212,3 +218,5 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/more_options_layout" />
|
app:layout_constraintTop_toBottomOf="@id/more_options_layout" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -4,8 +4,9 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="8dp"
|
android:padding="12dp"
|
||||||
android:layout_marginBottom="8dp">
|
android:layout_marginBottom="8dp"
|
||||||
|
android:background="@drawable/round_bg">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/utxo_coin_label"
|
android:id="@+id/utxo_coin_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -16,7 +17,7 @@
|
||||||
android:textColor="@color/oled_addressListColor"
|
android:textColor="@color/oled_addressListColor"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/utxo_outpoint_textview"
|
app:layout_constraintEnd_toStartOf="@id/utxo_outpoint_textview"
|
||||||
app:layout_constraintBottom_toTopOf="@id/utxo_pub_key_label"
|
app:layout_constraintBottom_toTopOf="@id/utxo_address_label"
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/utxo_outpoint_textview"
|
android:id="@+id/utxo_outpoint_textview"
|
||||||
|
@ -30,32 +31,60 @@
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/utxo_coin_label"
|
app:layout_constraintStart_toEndOf="@id/utxo_coin_label"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintBottom_toTopOf="@id/utxo_pub_key_label"
|
app:layout_constraintBottom_toTopOf="@id/utxo_address_label"
|
||||||
android:singleLine="true" />
|
android:singleLine="true" />
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/utxo_pub_key_label"
|
android:id="@+id/utxo_address_label"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Public Key"
|
android:text="Address"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
|
|
||||||
android:textColor="@color/oled_addressListColor"
|
android:textColor="@color/oled_addressListColor"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toStartOf="@id/utxo_address_textview"
|
||||||
app:layout_constraintBottom_toTopOf="@id/utxo_pub_key_textview"
|
app:layout_constraintBottom_toTopOf="@id/utxo_pub_key_label"
|
||||||
app:layout_constraintTop_toBottomOf="@id/utxo_coin_label"/>
|
app:layout_constraintTop_toBottomOf="@id/utxo_coin_label"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/utxo_address_textview"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Address"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:ellipsize="middle"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/utxo_address_label"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/utxo_address_label"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/utxo_address_label"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/utxo_pub_key_label"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Public Key"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:textColor="@color/oled_addressListColor"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/utxo_pub_key_textview"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/utxo_amount_label"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/utxo_address_label"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/utxo_pub_key_textview"
|
android:id="@+id/utxo_pub_key_textview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Public Key"
|
android:text="Public Key"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:layout_marginStart="32dp"
|
android:ellipsize="middle"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:singleLine="true"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/utxo_pub_key_label"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintBottom_toTopOf="@id/utxo_amount_label"
|
app:layout_constraintBottom_toTopOf="@id/utxo_pub_key_label"
|
||||||
app:layout_constraintTop_toBottomOf="@id/utxo_pub_key_label"/>
|
app:layout_constraintTop_toBottomOf="@id/utxo_pub_key_label"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/utxo_amount_label"
|
android:id="@+id/utxo_amount_label"
|
||||||
|
|
Loading…
Reference in a new issue