+ public static ObservableValue<Boolean> updating = new ObservableValue<>();
+ public static ObservableValue<String> updateError = new ObservableValue<>();
+
+ public static void scheduleTransactionListReload() {
+ if (Data.profile.get() == null) return;
+
+ String filter = TransactionListFragment.accountFilter.get();
+ AsyncTask<String, Void, String> task = new UTT();
+ task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, filter);
+ }
+ public static TransactionListItem getTransactionListItem(int position) {
+ List<TransactionListItem> transactions = Data.transactions.get();
+ if (transactions == null) return null;
+ if (position >= transactions.size() + 1) return null;
+ if (position == transactions.size()) return new TransactionListItem();
+ return transactions.get(position);
+ }
+ public static int getTransactionCount() {
+ List<TransactionListItem> transactions = Data.transactions.get();
+ if (transactions == null) return 0;
+ return transactions.size();
+ }
+ private static class UTT extends UpdateTransactionsTask {
+ @Override
+ protected void onPostExecute(String error) {
+ super.onPostExecute(error);
+ if (error != null) updateError.set(error);
+ }
+ }