+ b.navProfileList.setLayoutManager(llm);
+
+ b.navProfilesStartEdit.setOnClickListener((v) -> mProfileListAdapter.flipEditingProfiles());
+ b.navProfilesCancelEdit.setOnClickListener(
+ (v) -> mProfileListAdapter.flipEditingProfiles());
+ b.navProfileListHeadButtons.setOnClickListener(
+ (v) -> mProfileListAdapter.flipEditingProfiles());
+ if (drawerListener == null) {
+ drawerListener = new DrawerLayout.SimpleDrawerListener() {
+ @Override
+ public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {
+ if (slideOffset > 0.2)
+ fabHide();
+ }
+ @Override
+ public void onDrawerClosed(View drawerView) {
+ super.onDrawerClosed(drawerView);
+ mProfileListAdapter.setAnimationsEnabled(false);
+ mProfileListAdapter.editingProfiles.setValue(false);
+ Data.drawerOpen.setValue(false);
+ fabShouldShow();
+ }
+ @Override
+ public void onDrawerOpened(View drawerView) {
+ super.onDrawerOpened(drawerView);
+ mProfileListAdapter.setAnimationsEnabled(true);
+ Data.drawerOpen.setValue(true);
+ fabHide();
+ }
+ };
+ b.drawerLayout.addDrawerListener(drawerListener);
+ }
+
+ Data.drawerOpen.observe(this, open -> {
+ if (open)
+ b.drawerLayout.open();
+ else
+ b.drawerLayout.close();
+ });
+
+ mainModel.getUpdateError()
+ .observe(this, (error) -> {
+ if (error == null)
+ return;
+
+ Snackbar.make(b.mainPager, error, Snackbar.LENGTH_LONG)
+ .show();
+ mainModel.clearUpdateError();
+ });
+ Data.locale.observe(this, l -> refreshLastUpdateInfo());
+ Data.lastUpdateDate.observe(this, date -> refreshLastUpdateInfo());
+ Data.lastUpdateTransactionCount.observe(this, date -> refreshLastUpdateInfo());
+ Data.lastUpdateAccountCount.observe(this, date -> refreshLastUpdateInfo());
+ b.navAccountSummary.setOnClickListener(this::onAccountSummaryClicked);
+ b.navLatestTransactions.setOnClickListener(this::onLatestTransactionsClicked);