private double getAllPays() { double summa = 0; for (Pay pay : printList) { summa += pay.getPay(); } return summa; }
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); }
@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); }