Finalize UTXO cell layout (0.4.4.5, ready for release)

This commit is contained in:
pokkst 2023-07-10 08:46:24 -05:00
parent 3545b0ded6
commit f5cf9a24e5
No known key found for this signature in database
GPG key ID: 90C2ED85E67A50FF
9 changed files with 255 additions and 207 deletions

View file

@ -9,8 +9,8 @@ android {
applicationId "net.mynero.wallet"
minSdkVersion 21
targetSdkVersion 34
versionCode 40404
versionName "0.4.4.4 'Fluorine Fermi'"
versionCode 40405
versionName "0.4.4.5 'Fluorine Fermi'"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {

View file

@ -1135,10 +1135,11 @@ Java_net_mynero_wallet_model_Wallet_getCoinsJ(JNIEnv *env, jobject instance) {
jobject newCoinsInfo(JNIEnv *env, Monero::CoinsInfo *info) {
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 _pub_key = env->NewStringUTF(info->pubKey().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,
static_cast<jlong> (info->globalOutputIndex()),
info->spent(),
@ -1148,10 +1149,12 @@ jobject newCoinsInfo(JNIEnv *env, Monero::CoinsInfo *info) {
_pub_key,
info->unlocked(),
static_cast<jlong> (info->internalOutputIndex()),
info->frozen());
info->frozen(),
_address);
env->DeleteLocalRef(_key_image);
env->DeleteLocalRef(_hash);
env->DeleteLocalRef(_pub_key);
env->DeleteLocalRef(_address);
return result;
}

View file

@ -138,22 +138,24 @@ public class CoinsInfoAdapter extends RecyclerView.Adapter<CoinsInfoAdapter.View
TextView pubKeyTextView = itemView.findViewById(R.id.utxo_pub_key_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 outpointTextView = itemView.findViewById(R.id.utxo_outpoint_textview);
boolean streetModeEnabled = PrefService.getInstance().getBoolean(Constants.PREF_STREET_MODE, false);
String balanceString = streetModeEnabled ? Constants.STREET_MODE_BALANCE : Wallet.getDisplayAmount(coinsInfo.getAmount());
amountTextView.setText(itemView.getResources().getString(R.string.tx_amount_no_prefix, balanceString));
pubKeyTextView.setText(coinsInfo.getPubKey());
addressTextView.setText(coinsInfo.getAddress());
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()));
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()) {
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()) {
itemView.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.oled_locked_utxo));
itemView.setBackgroundTintList(ContextCompat.getColorStateList(itemView.getContext(), R.color.oled_locked_utxo));
} else {
itemView.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), android.R.color.transparent));
itemView.setBackgroundTintList(ContextCompat.getColorStateList(itemView.getContext(), R.color.oled_dialogBackgroundColor));
}
}

View file

@ -47,8 +47,9 @@ public class CoinsInfo implements Parcelable, Comparable<CoinsInfo> {
boolean unlocked;
long localOutputIndex;
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.spent = spent;
this.keyImage = keyImage;
@ -58,6 +59,7 @@ public class CoinsInfo implements Parcelable, Comparable<CoinsInfo> {
this.unlocked = unlocked;
this.localOutputIndex = localOutputIndex;
this.frozen = frozen;
this.address = address;
}
protected CoinsInfo(Parcel in) {
@ -100,6 +102,10 @@ public class CoinsInfo implements Parcelable, Comparable<CoinsInfo> {
return frozen;
}
public String getAddress() {
return address;
}
@Override
public int describeContents() {
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

View file

@ -3,16 +3,22 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingEnd="24dp"
android:paddingStart="24dp"
android:paddingTop="24dp">
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:scaleType="fitEnd"
android:src="@drawable/xmrchan_half"
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
android:id="@+id/create_wallet_textview"
android:layout_width="match_parent"
@ -211,4 +217,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/more_options_layout" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -4,8 +4,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:layout_marginBottom="8dp">
android:padding="12dp"
android:layout_marginBottom="8dp"
android:background="@drawable/round_bg">
<TextView
android:id="@+id/utxo_coin_label"
android:layout_width="wrap_content"
@ -16,7 +17,7 @@
android:textColor="@color/oled_addressListColor"
app:layout_constraintStart_toStartOf="parent"
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"/>
<TextView
android:id="@+id/utxo_outpoint_textview"
@ -30,32 +31,60 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/utxo_coin_label"
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" />
<TextView
android:id="@+id/utxo_pub_key_label"
android:layout_width="match_parent"
android:id="@+id/utxo_address_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Public Key"
android:text="Address"
android:textStyle="bold"
android:textSize="20sp"
android:layout_marginStart="16dp"
android:textColor="@color/oled_addressListColor"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/utxo_pub_key_textview"
app:layout_constraintEnd_toStartOf="@id/utxo_address_textview"
app:layout_constraintBottom_toTopOf="@id/utxo_pub_key_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
android:id="@+id/utxo_pub_key_textview"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Public Key"
android:textSize="14sp"
android:layout_marginStart="32dp"
app:layout_constraintStart_toStartOf="parent"
android:ellipsize="middle"
android:singleLine="true"
android:layout_marginStart="8dp"
app:layout_constraintStart_toEndOf="@id/utxo_pub_key_label"
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"/>
<TextView
android:id="@+id/utxo_amount_label"