2 * Copyright © 2019 Damyan Ivanov.
3 * This file is part of Mobile-Ledger.
4 * Mobile-Ledger is free software: you can distribute it and/or modify it
5 * under the term of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your opinion), any later version.
9 * Mobile-Ledger is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License terms for details.
14 * You should have received a copy of the GNU General Public License
15 * along with Mobile-Ledger. If not, see <https://www.gnu.org/licenses/>.
18 package net.ktnx.mobileledger.ui.transaction_list;
20 import net.ktnx.mobileledger.model.LedgerTransaction;
21 import net.ktnx.mobileledger.model.LedgerTransactionAccount;
23 class TransactionLoaderStep {
25 private int accountCount;
26 private TransactionListAdapter.LoaderStep step;
27 private TransactionRowHolder holder;
28 private LedgerTransaction transaction;
29 private LedgerTransactionAccount account;
30 private int accountPosition;
31 private String boldAccountName;
33 public TransactionLoaderStep(TransactionRowHolder holder, int position,
34 LedgerTransaction transaction, boolean isOdd) {
35 this.step = TransactionListAdapter.LoaderStep.HEAD;
37 this.transaction = transaction;
38 this.position = position;
41 public TransactionLoaderStep(TransactionRowHolder holder, LedgerTransactionAccount account,
42 int accountPosition, String boldAccountName) {
43 this.step = TransactionListAdapter.LoaderStep.ACCOUNTS;
45 this.account = account;
46 this.accountPosition = accountPosition;
47 this.boldAccountName = boldAccountName;
49 public TransactionLoaderStep(TransactionRowHolder holder, int position, int accountCount) {
50 this.step = TransactionListAdapter.LoaderStep.DONE;
52 this.position = position;
53 this.accountCount = accountCount;
55 public int getAccountCount() {
58 public int getPosition() {
61 public String getBoldAccountName() {
62 return boldAccountName;
64 public int getAccountPosition() {
65 return accountPosition;
67 public TransactionRowHolder getHolder() {
70 public TransactionListAdapter.LoaderStep getStep() {
73 public LedgerTransaction getTransaction() {
76 public LedgerTransactionAccount getAccount() {
79 public boolean isOdd() {