|
|
|
@ -91,16 +91,15 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
|
|
|
|
|
Collections.sort(data, new Comparator<TransactionInfo>() {
|
|
|
|
|
@Override
|
|
|
|
|
public int compare(TransactionInfo o1, TransactionInfo o2) {
|
|
|
|
|
if ((o1.isPending) && (o2.isPending)) {
|
|
|
|
|
long b1 = o1.timestamp;
|
|
|
|
|
long b2 = o2.timestamp;
|
|
|
|
|
return (b1 > b2) ? -1 : (b1 < b2) ? 1 : 0;
|
|
|
|
|
long b1 = o1.timestamp;
|
|
|
|
|
long b2 = o2.timestamp;
|
|
|
|
|
if (b1>b2) {
|
|
|
|
|
return -1;
|
|
|
|
|
} else if (b1<b2) {
|
|
|
|
|
return 1;
|
|
|
|
|
} else {
|
|
|
|
|
return o1.hash.compareTo(o2.hash);
|
|
|
|
|
}
|
|
|
|
|
if (o1.isPending) return -1;
|
|
|
|
|
if (o2.isPending) return 1;
|
|
|
|
|
long b1 = o1.blockheight;
|
|
|
|
|
long b2 = o2.blockheight;
|
|
|
|
|
return (b1 > b2) ? -1 : (b1 < b2) ? 1 : 0;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.infoItems.addAll(data);
|
|
|
|
@ -150,15 +149,15 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
|
|
|
|
|
|
|
|
|
|
this.tvAmount.setText(amountParts[0]);
|
|
|
|
|
this.tvAmountDecimal.setText(amountParts[1]);
|
|
|
|
|
if (infoItem.isPending) {
|
|
|
|
|
if (infoItem.isFailed) {
|
|
|
|
|
this.tvAmount.setText('(' + amountParts[0]);
|
|
|
|
|
this.tvAmountDecimal.setText(amountParts[1] + ')');
|
|
|
|
|
setTxColour(TX_FAILED);
|
|
|
|
|
} else if (infoItem.isPending) {
|
|
|
|
|
setTxColour(TX_PENDING);
|
|
|
|
|
if (infoItem.direction == TransactionInfo.Direction.Direction_Out) {
|
|
|
|
|
this.tvAmount.setText('-' + amountParts[0]);
|
|
|
|
|
}
|
|
|
|
|
} else if (infoItem.isFailed) {
|
|
|
|
|
this.tvAmount.setText('(' + amountParts[0]);
|
|
|
|
|
this.tvAmountDecimal.setText(amountParts[1] + ')');
|
|
|
|
|
setTxColour(TX_FAILED);
|
|
|
|
|
} else if (infoItem.direction == TransactionInfo.Direction.Direction_In) {
|
|
|
|
|
setTxColour(TX_GREEN);
|
|
|
|
|
} else {
|
|
|
|
|