@Override
    public void bindView(final View view, final Context context, final Cursor cursor) {
      final ExchangeRate exchangeRate = ExchangeRatesProvider.getExchangeRate(cursor);
      final boolean isDefaultCurrency = exchangeRate.getCurrencyCode().equals(defaultCurrency);

      view.setBackgroundResource(isDefaultCurrency ? R.color.bg_list_selected : R.color.bg_list);

      final View defaultView = view.findViewById(R.id.exchange_rate_row_default);
      defaultView.setVisibility(isDefaultCurrency ? View.VISIBLE : View.INVISIBLE);

      final TextView currencyCodeView =
          (TextView) view.findViewById(R.id.exchange_rate_row_currency_code);
      currencyCodeView.setText(exchangeRate.getCurrencyCode());

      final CurrencyTextView rateView =
          (CurrencyTextView) view.findViewById(R.id.exchange_rate_row_rate);
      rateView.setFormat(Constants.LOCAL_FORMAT);
      rateView.setAmount(exchangeRate.rate.coinToFiat(rateBase));

      final CurrencyTextView walletView =
          (CurrencyTextView) view.findViewById(R.id.exchange_rate_row_balance);
      walletView.setFormat(Constants.LOCAL_FORMAT);
      if (blockchainState == null || !blockchainState.replaying) {
        walletView.setAmount(exchangeRate.rate.coinToFiat(balance));
        walletView.setStrikeThru(Constants.TEST);
      } else {
        walletView.setText("n/a");
        walletView.setStrikeThru(false);
      }
      walletView.setTextColor(getResources().getColor(R.color.fg_less_significant));
    }
  public void bindView(@Nonnull final View row, @Nonnull final Transaction tx) {
    final TransactionConfidence confidence = tx.getConfidence();
    final ConfidenceType confidenceType = confidence.getConfidenceType();
    final boolean isOwn = confidence.getSource().equals(TransactionConfidence.Source.SELF);
    final boolean isCoinBase = tx.isCoinBase();
    final boolean isInternal = WalletUtils.isInternal(tx);

    try {
      final BigInteger value = tx.getValue(wallet);
      final boolean sent = value.signum() < 0;

      final CircularProgressView rowConfidenceCircular =
          (CircularProgressView) row.findViewById(R.id.transaction_row_confidence_circular);
      final TextView rowConfidenceTextual =
          (TextView) row.findViewById(R.id.transaction_row_confidence_textual);

      // confidence
      if (confidenceType == ConfidenceType.PENDING) {
        rowConfidenceCircular.setVisibility(View.VISIBLE);
        rowConfidenceTextual.setVisibility(View.GONE);

        rowConfidenceCircular.setProgress(1);
        rowConfidenceCircular.setMaxProgress(1);
        rowConfidenceCircular.setSize(confidence.numBroadcastPeers());
        rowConfidenceCircular.setMaxSize(maxConnectedPeers / 2); // magic value
        rowConfidenceCircular.setColors(colorInsignificant, colorInsignificant);
      } else if (confidenceType == ConfidenceType.BUILDING) {
        rowConfidenceCircular.setVisibility(View.VISIBLE);
        rowConfidenceTextual.setVisibility(View.GONE);

        rowConfidenceCircular.setProgress(confidence.getDepthInBlocks());
        rowConfidenceCircular.setMaxProgress(
            isCoinBase
                ? Constants.NETWORK_PARAMETERS.getSpendableCoinbaseDepth()
                : Constants.MAX_NUM_CONFIRMATIONS);
        rowConfidenceCircular.setSize(1);
        rowConfidenceCircular.setMaxSize(1);
        rowConfidenceCircular.setColors(colorCircularBuilding, Color.DKGRAY);
      } else if (confidenceType == ConfidenceType.DEAD) {
        rowConfidenceCircular.setVisibility(View.GONE);
        rowConfidenceTextual.setVisibility(View.VISIBLE);

        rowConfidenceTextual.setText(CONFIDENCE_SYMBOL_DEAD);
        rowConfidenceTextual.setTextColor(Color.RED);
      } else {
        rowConfidenceCircular.setVisibility(View.GONE);
        rowConfidenceTextual.setVisibility(View.VISIBLE);

        rowConfidenceTextual.setText(CONFIDENCE_SYMBOL_UNKNOWN);
        rowConfidenceTextual.setTextColor(colorInsignificant);
      }

      // spendability
      final int textColor;
      if (confidenceType == ConfidenceType.DEAD) textColor = Color.RED;
      else textColor = DefaultCoinSelector.isSelectable(tx) ? colorSignificant : colorInsignificant;

      // time
      final TextView rowTime = (TextView) row.findViewById(R.id.transaction_row_time);
      if (rowTime != null) {
        final Date time = tx.getUpdateTime();
        rowTime.setText(
            time != null ? (DateUtils.getRelativeTimeSpanString(context, time.getTime())) : null);
        rowTime.setTextColor(textColor);
      }

      // receiving or sending
      final TextView rowFromTo = (TextView) row.findViewById(R.id.transaction_row_fromto);
      if (isInternal) rowFromTo.setText(R.string.symbol_internal);
      else if (sent) rowFromTo.setText(R.string.symbol_to);
      else rowFromTo.setText(R.string.symbol_from);
      rowFromTo.setTextColor(textColor);

      // coinbase
      final View rowCoinbase = row.findViewById(R.id.transaction_row_coinbase);
      rowCoinbase.setVisibility(isCoinBase ? View.VISIBLE : View.GONE);

      // address
      final TextView rowAddress = (TextView) row.findViewById(R.id.transaction_row_address);
      final Address address =
          sent ? WalletUtils.getFirstToAddress(tx) : WalletUtils.getFirstFromAddress(tx);
      final String label;
      if (isCoinBase) label = textCoinBase;
      else if (isInternal) label = textInternal;
      else if (address != null) label = resolveLabel(address.toString());
      else label = "?";
      rowAddress.setTextColor(textColor);
      rowAddress.setText(label != null ? label : address.toString());
      rowAddress.setTypeface(label != null ? Typeface.DEFAULT : Typeface.MONOSPACE);

      // value
      final CurrencyTextView rowValue =
          (CurrencyTextView) row.findViewById(R.id.transaction_row_value);
      rowValue.setTextColor(textColor);
      rowValue.setAlwaysSigned(true);
      rowValue.setPrecision(precision, shift);
      rowValue.setAmount(value);

      // extended message
      final View rowExtend = row.findViewById(R.id.transaction_row_extend);
      if (rowExtend != null) {
        final TextView rowMessage = (TextView) row.findViewById(R.id.transaction_row_message);
        final boolean isTimeLocked = tx.isTimeLocked();
        rowExtend.setVisibility(View.GONE);

        if (tx.getPurpose() == Purpose.KEY_ROTATION) {
          rowExtend.setVisibility(View.VISIBLE);
          rowMessage.setText(
              Html.fromHtml(
                  context.getString(R.string.transaction_row_message_purpose_key_rotation)));
          rowMessage.setTextColor(colorSignificant);
        } else if (isOwn
            && confidenceType == ConfidenceType.PENDING
            && confidence.numBroadcastPeers() == 0) {
          rowExtend.setVisibility(View.VISIBLE);
          rowMessage.setText(R.string.transaction_row_message_own_unbroadcasted);
          rowMessage.setTextColor(colorInsignificant);
        } else if (!isOwn
            && confidenceType == ConfidenceType.PENDING
            && confidence.numBroadcastPeers() == 0) {
          rowExtend.setVisibility(View.VISIBLE);
          rowMessage.setText(R.string.transaction_row_message_received_direct);
          rowMessage.setTextColor(colorInsignificant);
        } else if (!sent && value.compareTo(Transaction.MIN_NONDUST_OUTPUT) < 0) {
          rowExtend.setVisibility(View.VISIBLE);
          rowMessage.setText(R.string.transaction_row_message_received_dust);
          rowMessage.setTextColor(colorInsignificant);
        } else if (!sent && confidenceType == ConfidenceType.PENDING && isTimeLocked) {
          rowExtend.setVisibility(View.VISIBLE);
          rowMessage.setText(R.string.transaction_row_message_received_unconfirmed_locked);
          rowMessage.setTextColor(colorError);
        } else if (!sent && confidenceType == ConfidenceType.PENDING && !isTimeLocked) {
          rowExtend.setVisibility(View.VISIBLE);
          rowMessage.setText(R.string.transaction_row_message_received_unconfirmed_unlocked);
          rowMessage.setTextColor(colorInsignificant);
        } else if (!sent && confidenceType == ConfidenceType.DEAD) {
          rowExtend.setVisibility(View.VISIBLE);
          rowMessage.setText(R.string.transaction_row_message_received_dead);
          rowMessage.setTextColor(colorError);
        }
      }
    } catch (final ScriptException x) {
      throw new RuntimeException(x);
    }
  }