private static AtomicInteger backgroundTaskCount = new AtomicInteger(0);
private static Locker profilesLocker = new Locker();
private static RetrieveTransactionsTask retrieveTransactionsTask;
+ public static MutableLiveData<Boolean> drawerOpen = new MutableLiveData<>(false);
public static void backgroundTaskStarted() {
int cnt = backgroundTaskCount.incrementAndGet();
debug("data",
};
drawer.addDrawerListener(drawerListener);
}
+
+ Data.drawerOpen.observe(this, open -> {
+ if (open)
+ drawer.open();
+ else
+ drawer.close();
+ });
}
private void scheduleDataRetrievalIfStale(Date lastUpdate) {
long now = new Date().getTime();
mProfileListAdapter.notifyDataSetChanged();
- drawer.closeDrawers();
-
Data.transactions.clear();
debug("transactions", "requesting list reload");
TransactionListViewModel.scheduleTransactionListReload();
if (profile == null)
throw new IllegalStateException("Profile row without associated profile");
debug("profiles", "Setting profile to " + profile.getName());
+ if (Data.profile.getValue() != profile )
+ Data.drawerOpen.setValue(false);
Data.setCurrentProfile(profile);
}
@NonNull