X-Git-Url: https://git.ktnx.net/?p=mobile-ledger-staging.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fmodel%2FData.java;h=f0f3987789e56673285923eee2209dc915d10b13;hp=66738cb0ba3c2d9303dfd1a5533be836dfb56b5e;hb=8ca38438602c8addcbce91167d467e6da0ba962b;hpb=2d85826653a8ba3e619afc83c5c91216a7fdb0b6 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 66738cb0..f0f39877 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/Data.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/Data.java @@ -56,8 +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 lastUpdateLiveData = new MutableLiveData<>(null); - public static final ObservableValue lastUpdate = new ObservableValue<>(); + 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); @@ -89,6 +94,10 @@ public final class Data { MLDB.setOption(MLDB.OPT_PROFILE_UUID, newProfile.getUuid()); profile.setValue(newProfile); } + public static void postCurrentProfile(@NonNull MobileLedgerProfile newProfile) { + MLDB.setOption(MLDB.OPT_PROFILE_UUID, newProfile.getUuid()); + profile.postValue(newProfile); + } public static int getProfileIndex(MobileLedgerProfile profile) { try (LockHolder ignored = profilesLocker.lockForReading()) { List prList = profiles.getValue(); @@ -195,6 +204,7 @@ public final class Data { MobileLedgerProfile startupProfile = getProfile(profileUUID); if (startupProfile != null) setCurrentProfile(startupProfile); + Logger.debug("profile", "initProfile() returning " + startupProfile); return startupProfile; }