예제 #1
0
 public void setTransactionType(TransactionType type) {
   mCalculatorOutputInfo.transactionType = type;
   mViewHolder.textViewIncomingOrOutgoing.setText(getTransactionTypeName(type));
   int productNameTextColor =
       type == TransactionType.Incoming ? R.color.incoming_text_color : R.color.expense_text_color;
   mViewHolder.textViewIncomingOrOutgoing.setTextColor(
       getResources().getColor(productNameTextColor));
 }
예제 #2
0
  public CalculatorOutputInfo getOutputInfo() {
    mCalculatorOutputInfo.price = getPrice();
    mCalculatorOutputInfo.quantity = getQuantityValue();

    return mCalculatorOutputInfo;
  }
예제 #3
0
 public void setTransactionDate(Date date) {
   mCalculatorOutputInfo.date = date;
   mViewHolder.textViewTransactionDate.setText(
       date != null ? DateTimeUtils.formatDateTime(date) : "");
   mViewHolder.textViewTransactionDate.setVisibility(date != null ? View.VISIBLE : View.GONE);
 }
예제 #4
0
 public void setCurrencyCode(String currencyCode) {
   mCalculatorOutputInfo.currencyCode = currencyCode;
   mViewHolder.textViewCurrencyCode.setText(currencyCode);
 }
예제 #5
0
 public void setProduct(Product product) {
   mCalculatorOutputInfo.product = product;
   setProductName(product != null ? product.getName() : "");
 }
예제 #6
0
 public void setProductName(String name) {
   mCalculatorOutputInfo.productName = name;
   mViewHolder.textViewCalculatorProductName.setText(name);
 }
예제 #7
0
 public void setLastPrice(BigDecimal price) {
   mIsLastPrice = true;
   mCalculatorOutputInfo.price = price;
   mViewHolder.textViewCalculatorPrice.setText(price.toString());
 }
예제 #8
0
 public void clear() {
   mCalculatorOutputInfo.price = new BigDecimal("0");
   mViewHolder.textViewCalculatorPrice.setText("0");
 }