Exemplo n.º 1
0
  private double getAllPays() {

    double summa = 0;
    for (Pay pay : printList) {
      summa += pay.getPay();
    }

    return summa;
  }
Exemplo n.º 2
0
  private void copyList(Currency currency) {
    printList = new ArrayList<>();

    for (Pay pay : pays)
      try {
        printList.add(pay.clone());
      } catch (CloneNotSupportedException e) {
        e.printStackTrace();
      }
    recalc(currency, pays);
  }
Exemplo n.º 3
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    inflateHeater(inflater);
    copyList(Currency.BYR);

    if (!pays.isEmpty()) {
      int size = pays.size();
      Pay pay = (pays.size() == 1) ? pays.get(0) : pays.get(size - 1);
      if ((int) pay.getBalance() == 0) inflateHeaderTotal(inflater);
      else inflateFooter(inflater);
    } else inflateFooter(inflater);

    return super.onCreateView(inflater, container, savedInstanceState);
  }