X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fmodel%2FData.java;h=a6d3fd9825dd4ce69e59712d1654986132d3ee9e;hb=d08ab8235d0fd152c772b2dd5ffa1ca5747f67b1;hp=8b4def9509547d89fb4c92c7bd47551167360b3d;hpb=7979c30fbec50954aa35d66f9e4558f4233824e3;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/model/Data.java b/app/src/main/java/net/ktnx/mobileledger/model/Data.java index 8b4def95..a6d3fd98 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/Data.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/Data.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Damyan Ivanov. + * Copyright © 2020 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -31,6 +31,7 @@ import net.ktnx.mobileledger.utils.Locker; import net.ktnx.mobileledger.utils.Logger; import net.ktnx.mobileledger.utils.MLDB; import net.ktnx.mobileledger.utils.ObservableList; +import net.ktnx.mobileledger.utils.SimpleDate; import java.lang.ref.WeakReference; import java.text.NumberFormat; @@ -43,22 +44,28 @@ import java.util.concurrent.atomic.AtomicInteger; import static net.ktnx.mobileledger.utils.Logger.debug; public final class Data { - public static ObservableList transactions = + public static final ObservableList transactions = new ObservableList<>(new ArrayList<>()); - public static ObservableList accounts = new ObservableList<>(new ArrayList<>()); - public static MutableLiveData backgroundTasksRunning = new MutableLiveData<>(false); - public static MutableLiveData lastUpdateDate = new MutableLiveData<>(); - public static MutableLiveData profile = new InertMutableLiveData<>(); - public static MutableLiveData> profiles = + public static final MutableLiveData earliestTransactionDate = new MutableLiveData<>(null); - public static MutableLiveData accountFilter = new MutableLiveData<>(); - public static MutableLiveData currencySymbolPosition = + public static final MutableLiveData latestTransactionDate = + new MutableLiveData<>(null); + public static final MutableLiveData backgroundTasksRunning = + new MutableLiveData<>(false); + public static final MutableLiveData lastUpdateDate = new MutableLiveData<>(); + public static final MutableLiveData profile = new InertMutableLiveData<>(); + public static final MutableLiveData> profiles = + new MutableLiveData<>(null); + public static final MutableLiveData accountFilter = new MutableLiveData<>(); + public static final MutableLiveData currencySymbolPosition = new MutableLiveData<>(); - public static MutableLiveData currencyGap = new MutableLiveData<>(true); - public static MutableLiveData locale = new MutableLiveData<>(Locale.getDefault()); - private static AtomicInteger backgroundTaskCount = new AtomicInteger(0); - private static Locker profilesLocker = new Locker(); + public static final MutableLiveData currencyGap = new MutableLiveData<>(true); + public static final MutableLiveData locale = new MutableLiveData<>(Locale.getDefault()); + private static final AtomicInteger backgroundTaskCount = new AtomicInteger(0); + private static final Locker profilesLocker = new Locker(); + public static MutableLiveData foundTransactionItemIndex = new MutableLiveData<>(null); private static RetrieveTransactionsTask retrieveTransactionsTask; + public static final MutableLiveData drawerOpen = new MutableLiveData<>(false); public static void backgroundTaskStarted() { int cnt = backgroundTaskCount.incrementAndGet(); debug("data",