import net.ktnx.mobileledger.async.RetrieveTransactionsTask;
import net.ktnx.mobileledger.async.TransactionAccumulator;
-import net.ktnx.mobileledger.async.UpdateTransactionsTask;
import net.ktnx.mobileledger.db.Profile;
import net.ktnx.mobileledger.model.Data;
import net.ktnx.mobileledger.model.LedgerAccount;
public class MainModel extends ViewModel {
public final MutableLiveData<Integer> foundTransactionItemIndex = new MutableLiveData<>(null);
private final MutableLiveData<Boolean> updatingFlag = new MutableLiveData<>(false);
- private final MutableLiveData<String> accountFilter = new MutableLiveData<>();
+ private final MutableLiveData<String> accountFilter = new MutableLiveData<>(null);
private final MutableLiveData<List<TransactionListItem>> displayedTransactions =
new MutableLiveData<>(new ArrayList<>());
private final MutableLiveData<String> updateError = new MutableLiveData<>();
transient private RetrieveTransactionsTask retrieveTransactionsTask;
transient private Thread displayedAccountsUpdater;
private TransactionsDisplayedFilter displayedTransactionsUpdater;
- public void scheduleTransactionListReload() {
- UpdateTransactionsTask task = new UpdateTransactionsTask();
- task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, this);
- }
public LiveData<Boolean> getUpdatingFlag() {
return updatingFlag;
}
@Override
public void run() {
List<LedgerAccount> newDisplayed = new ArrayList<>();
- Logger.debug("dFilter", "waiting for synchronized block");
Logger.debug("dFilter", String.format(Locale.US,
"entered synchronized block (about to examine %d transactions)", list.size()));
String accNameFilter = model.getAccountFilter()