]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionLoaderStep.java
fix transaction colouring to ignore delimiter items
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / transaction_list / TransactionLoaderStep.java
1 /*
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.
8  *
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.
13  *
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/>.
16  */
17
18 package net.ktnx.mobileledger.ui.transaction_list;
19
20 import net.ktnx.mobileledger.model.LedgerTransaction;
21 import net.ktnx.mobileledger.model.LedgerTransactionAccount;
22
23 class TransactionLoaderStep {
24     private int position;
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;
32     private boolean odd;
33     public TransactionLoaderStep(TransactionRowHolder holder, int position,
34                                  LedgerTransaction transaction, boolean isOdd) {
35         this.step = TransactionListAdapter.LoaderStep.HEAD;
36         this.holder = holder;
37         this.transaction = transaction;
38         this.position = position;
39         this.odd = isOdd;
40     }
41     public TransactionLoaderStep(TransactionRowHolder holder, LedgerTransactionAccount account,
42                                  int accountPosition, String boldAccountName) {
43         this.step = TransactionListAdapter.LoaderStep.ACCOUNTS;
44         this.holder = holder;
45         this.account = account;
46         this.accountPosition = accountPosition;
47         this.boldAccountName = boldAccountName;
48     }
49     public TransactionLoaderStep(TransactionRowHolder holder, int position, int accountCount) {
50         this.step = TransactionListAdapter.LoaderStep.DONE;
51         this.holder = holder;
52         this.position = position;
53         this.accountCount = accountCount;
54     }
55     public int getAccountCount() {
56         return accountCount;
57     }
58     public int getPosition() {
59         return position;
60     }
61     public String getBoldAccountName() {
62         return boldAccountName;
63     }
64     public int getAccountPosition() {
65         return accountPosition;
66     }
67     public TransactionRowHolder getHolder() {
68         return holder;
69     }
70     public TransactionListAdapter.LoaderStep getStep() {
71         return step;
72     }
73     public LedgerTransaction getTransaction() {
74         return transaction;
75     }
76     public LedgerTransactionAccount getAccount() {
77         return account;
78     }
79     public boolean isOdd() {
80         return odd;
81     }
82 }