diff --git a/app/src/main/java/com/m2049r/xmrwallet/layout/TransactionInfoAdapter.java b/app/src/main/java/com/m2049r/xmrwallet/layout/TransactionInfoAdapter.java index 835c3a14..da218804 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/layout/TransactionInfoAdapter.java +++ b/app/src/main/java/com/m2049r/xmrwallet/layout/TransactionInfoAdapter.java @@ -49,8 +49,6 @@ import java.util.TimeZone; import timber.log.Timber; public class TransactionInfoAdapter extends RecyclerView.Adapter { - private final static int MAX_CONFIRMATIONS = 10; - private final static SimpleDateFormat DATETIME_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm"); private final int outboundColour; @@ -81,7 +79,7 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter 0) && (infoItems.get(0).confirmations < MAX_CONFIRMATIONS); + return (infoItems.size() > 0) && !infoItems.get(0).isConfirmed(); } private static class TransactionInfoDiff extends DiffCallback { @@ -169,7 +167,7 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter { + public static final int CONFIRMATION = 10; // blocks + @RequiredArgsConstructor public enum Direction { Direction_In(0), @@ -98,6 +100,10 @@ public class TransactionInfo implements Parcelable, Comparable this.transfers = transfers; } + public boolean isConfirmed() { + return confirmations >= CONFIRMATION; + } + public String getDisplayLabel() { if (subaddressLabel.isEmpty() || (Subaddress.DEFAULT_LABEL_FORMATTER.matcher(subaddressLabel).matches())) return ("#" + addressIndex); diff --git a/app/src/main/res/layout/item_transaction.xml b/app/src/main/res/layout/item_transaction.xml index c9e55d71..e2107019 100644 --- a/app/src/main/res/layout/item_transaction.xml +++ b/app/src/main/res/layout/item_transaction.xml @@ -48,7 +48,7 @@