X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fmodel%2FData.java;h=f0ba846ec05d9271a7c4f390631cde6a9906c4e5;hb=f0fecef867dd49fe41fc733c11418f95a270be4a;hp=74e274d672d82e78d3d48b6b9975702294bc3283;hpb=5bba2c06a81c87327fdcf3f2a85c3206d932c2f9;p=mobile-ledger-staging.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 74e274d6..f0ba846e 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/Data.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/Data.java @@ -32,9 +32,11 @@ import net.ktnx.mobileledger.utils.LockHolder; import net.ktnx.mobileledger.utils.Locker; import net.ktnx.mobileledger.utils.Logger; import net.ktnx.mobileledger.utils.MLDB; +import net.ktnx.mobileledger.utils.ObservableValue; import java.text.NumberFormat; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Locale; import java.util.Objects; @@ -54,6 +56,13 @@ public final class Data { public static final MutableLiveData currencyGap = new MutableLiveData<>(true); public static final MutableLiveData locale = new MutableLiveData<>(); public static final MutableLiveData drawerOpen = new MutableLiveData<>(false); + public static final MutableLiveData lastUpdateDate = new MutableLiveData<>(null); + public static final MutableLiveData lastUpdateTransactionCount = + new MutableLiveData<>(0); + public static final MutableLiveData lastUpdateAccountCount = new MutableLiveData<>(0); + public static final ObservableValue lastTransactionsUpdateText = + new ObservableValue<>(); + public static final ObservableValue lastAccountsUpdateText = new ObservableValue<>(); private static final MutableLiveData profile = new InertMutableLiveData<>(); private static final AtomicInteger backgroundTaskCount = new AtomicInteger(0); @@ -83,7 +92,7 @@ public final class Data { } public static void setCurrentProfile(@NonNull MobileLedgerProfile newProfile) { MLDB.setOption(MLDB.OPT_PROFILE_UUID, newProfile.getUuid()); - profile.setValue(newProfile); + profile.postValue(newProfile); } public static int getProfileIndex(MobileLedgerProfile profile) { try (LockHolder ignored = profilesLocker.lockForReading()) {