Пример #1
0
  @Override
  public void bindData(
      CustomerBrokerNegotiationInformation negotiationInformation,
      ClauseInformation clause,
      int clausePosition) {
    super.bindData(negotiationInformation, clause, clausePosition);

    final Map<ClauseType, ClauseInformation> clauses = negotiationInformation.getClauses();
    final ClauseInformation currencyToBuy = clauses.get(ClauseType.CUSTOMER_CURRENCY);
    final ClauseInformation currencyToPay = clauses.get(ClauseType.BROKER_CURRENCY);

    double marketRate =
        212.48; // TODO cambiar por valor que devuelve el proveedor asociado a la wallet para este
                // par de monedas

    String formattedMarketRate = NumberFormat.getInstance().format(marketRate);

    markerRateReference.setText(
        String.format(
            "1 %1$s / %2$s %3$s",
            currencyToBuy.getValue(), formattedMarketRate, currencyToPay.getValue()));
    yourExchangeRateValueLeftSide.setText(String.format("1 %1$s /", currencyToBuy.getValue()));
    yourExchangeRateValue.setText(clause.getValue());
    yourExchangeRateValueRightSide.setText(String.format("%1$s", currencyToPay.getValue()));
  }
Пример #2
0
  @Override
  public void bindData(
      CustomerBrokerNegotiationInformation data, ClauseInformation clause, int position) {
    super.bindData(data, clause, position);

    final Map<ClauseType, ClauseInformation> clauses = data.getClauses();

    ClauseType currencyType = ClauseType.CUSTOMER_CURRENCY;
    int buyingTextValue = R.string.buying_text;

    if (!paymentBuy) {
      currencyType = ClauseType.BROKER_CURRENCY;
      buyingTextValue = R.string.paying_text;
    }

    final ClauseInformation currencyToBuy = clauses.get(currencyType);

    currencyToBuyTextValue.setText(currencyToBuy.getValue());
    buyingText.setText(buyingTextValue);
    if (clause.getValue().equals("0.0")
        || clause.getValue().equals("0")
        || clause.getValue().equals("0,0")) {
      buyingValue.setText(defaultValue());
    } else {
      buyingValue.setText(fixFormat(clause.getValue()));
    }
  }
Пример #3
0
  @Override
  public void setStatus(NegotiationStepStatus clauseStatus) {
    super.setStatus(clauseStatus);

    switch (clauseStatus) {
      case ACCEPTED:
        buyingText.setTextColor(getColor(R.color.description_text_status_accepted));
        currencyToBuyTextValue.setTextColor(getColor(R.color.ccw_text_value_status_accepted));
        separatorLineDown.setBackgroundColor(getColor(R.color.card_title_color_status_accepted));
        separatorLineUp.setBackgroundColor(getColor(R.color.card_title_color_status_accepted));
        break;
      case CHANGED:
        separatorLineDown.setBackgroundColor(getColor(R.color.description_text_status_changed));
        separatorLineUp.setBackgroundColor(getColor(R.color.description_text_status_changed));
        buyingText.setTextColor(getColor(R.color.description_text_status_changed));
        currencyToBuyTextValue.setTextColor(getColor(R.color.description_text_status_changed));
        break;
      case CONFIRM:
        buyingText.setTextColor(getColor(R.color.description_text_status_confirm));
        currencyToBuyTextValue.setTextColor(getColor(R.color.text_value_status_confirm));
        break;
    }
  }