- public static ObservableList<TransactionListItem> transactions =
- new ObservableList<>(new ArrayList<>());
- public static ObservableList<LedgerAccount> accounts = new ObservableList<>(new ArrayList<>());
- public static MutableLiveData<Boolean> backgroundTasksRunning = new MutableLiveData<>(false);
- public static MutableLiveData<Date> lastUpdateDate = new MutableLiveData<>();
- public static MutableLiveData<MobileLedgerProfile> profile = new MutableLiveData<>();
- public static MutableLiveData<ArrayList<MobileLedgerProfile>> profiles =
- new MutableLiveData<>(null);
- public static ObservableValue<Boolean> optShowOnlyStarred = new ObservableValue<>();
- public static MutableLiveData<String> accountFilter = new MutableLiveData<>();
- private static AtomicInteger backgroundTaskCount = new AtomicInteger(0);
- private static Locker profilesLocker = new Locker();
- private static RetrieveTransactionsTask retrieveTransactionsTask;
+ public static final MutableLiveData<Boolean> backgroundTasksRunning =
+ new MutableLiveData<>(false);
+ public static final MutableLiveData<RetrieveTransactionsTask.Progress> backgroundTaskProgress =
+ new MutableLiveData<>();
+ public static final LiveData<List<Profile>> profiles = DB.get()
+ .getProfileDAO()
+ .getAllOrdered();
+ public static final MutableLiveData<Currency.Position> currencySymbolPosition =
+ new MutableLiveData<>();
+ public static final MutableLiveData<Boolean> currencyGap = new MutableLiveData<>(true);
+ public static final MutableLiveData<Locale> locale = new MutableLiveData<>();
+ public static final MutableLiveData<Boolean> drawerOpen = new MutableLiveData<>(false);
+ public static final MutableLiveData<Date> lastUpdateDate = new MutableLiveData<>(null);
+ public static final MutableLiveData<Integer> lastUpdateTransactionCount =
+ new MutableLiveData<>(0);
+ public static final MutableLiveData<Integer> lastUpdateAccountCount = new MutableLiveData<>(0);
+ public static final MutableLiveData<String> lastTransactionsUpdateText =
+ new MutableLiveData<>();
+ public static final MutableLiveData<String> lastAccountsUpdateText = new MutableLiveData<>();
+ private static final MutableLiveData<Profile> profile = new MutableLiveData<>();
+ private static final AtomicInteger backgroundTaskCount = new AtomicInteger(0);
+ private static final Locker profilesLocker = new Locker();
+ private static NumberFormat numberFormatter;
+
+ static {
+ locale.setValue(Locale.getDefault());
+ }
+
+ @Nullable
+ public static Profile getProfile() {
+ return profile.getValue();
+ }