Update tx history cell layout

This commit is contained in:
pokkst 2022-10-25 00:25:45 -05:00
parent 2990c059ee
commit 08b3f23b66
No known key found for this signature in database
GPG key ID: 90C2ED85E67A50FF
3 changed files with 57 additions and 111 deletions

View file

@ -158,28 +158,6 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
((TextView) itemView.findViewById(R.id.tx_amount)).setText(itemView.getContext().getString(R.string.tx_list_amount_positive, displayAmount));
}
TextView paymentIdTextView = itemView.findViewById(R.id.tx_paymentid);
String tag = null;
String info = "";
UserNotes userNotes = new UserNotes(txInfo.notes);
if ((txInfo.addressIndex != 0) && (txInfo.direction == TransactionInfo.Direction.Direction_In))
tag = txInfo.getDisplayLabel();
if ((userNotes.note.isEmpty())) {
if (!txInfo.paymentId.equals("0000000000000000")) {
info = txInfo.paymentId;
}
} else {
info = userNotes.note;
}
if (tag == null) {
paymentIdTextView.setText(info);
} else {
Spanned label = Html.fromHtml(itemView.getContext().getString(R.string.tx_details_notes,
Integer.toHexString(ThemeHelper.getThemedColor(itemView.getContext(), R.attr.positiveColor) & 0xFFFFFF),
Integer.toHexString(ThemeHelper.getThemedColor(itemView.getContext(), android.R.attr.colorBackground) & 0xFFFFFF),
tag, info.isEmpty() ? "" : ("&nbsp; " + info)));
paymentIdTextView.setText(label);
}
((TextView) itemView.findViewById(R.id.tx_datetime)).setText(getDateTime(txInfo.timestamp));
itemView.setOnClickListener(view -> {
listener.onClickTransaction(txInfo);

View file

@ -49,8 +49,6 @@
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:clipToPadding="false"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:paddingBottom="128dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -2,106 +2,76 @@
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="8dp"
android:paddingTop="12dp"
android:paddingRight="8dp"
android:paddingBottom="12dp">
android:layout_height="match_parent">
<LinearLayout
android:layout_width="0dp"
<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/pbConfirmations"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="9"
android:orientation="horizontal">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/pbConfirmations"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_gravity="center"
android:indeterminate="false"
android:max="10"
android:progress="8"
android:visibility="visible"
app:indicatorInset="0dp"
app:indicatorSize="30dp"
app:trackThickness="4dp" />
<TextView
android:id="@+id/tvConfirmations"
style="@style/MoneroText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:paddingBottom="1dp"
android:text="8"
android:visibility="visible" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tx_amount"
style="@style/MoneroText.PosAmount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
tools:text="+ 999.999999" />
<TextView
android:id="@+id/tx_failed"
style="@style/MoneroText.PosFee"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:text="@string/tx_list_failed_text" />
</LinearLayout>
</LinearLayout>
android:indeterminate="false"
android:max="10"
android:progress="8"
android:visibility="visible"
app:indicatorInset="0dp"
app:indicatorSize="30dp"
app:trackThickness="4dp"
android:layout_marginStart="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/tx_amount"
app:layout_constraintBottom_toBottomOf="@id/tx_failed"/>
<TextView
android:id="@+id/tx_paymentid"
style="@style/MoneroText.PosNote"
android:id="@+id/tvConfirmations"
style="@style/MoneroText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="1dp"
android:text="8"
android:visibility="visible"
app:layout_constraintTop_toTopOf="@id/pbConfirmations"
app:layout_constraintBottom_toBottomOf="@id/pbConfirmations"
app:layout_constraintStart_toStartOf="@id/pbConfirmations"
app:layout_constraintEnd_toEndOf="@id/pbConfirmations"/>
<TextView
android:id="@+id/tx_amount"
style="@style/MoneroText.PosAmount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_weight="13"
android:gravity="start"
tools:text="0123456789abcdef" />
tools:text="+ 999.999999"
android:layout_marginTop="8dp"
android:layout_marginStart="8dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/pbConfirmations"
app:layout_constraintEnd_toStartOf="@id/tx_datetime"/>
<TextView
android:id="@+id/tx_failed"
style="@style/MoneroText.PosFee"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/tx_list_failed_text"
android:layout_marginBottom="8dp"
android:layout_marginStart="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/pbConfirmations"
app:layout_constraintTop_toBottomOf="@id/tx_amount"/>
<TextView
android:id="@+id/tx_datetime"
style="@style/MoneroText.PosDate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="6"
android:gravity="center"
tools:text="2017-05-22 21:32" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_navigate_next" />
</LinearLayout>
tools:text="2017-05-22 21:32"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginEnd="16dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>