+ Data.observeProfile(this, profile -> onProfileChanged(profile, Boolean.TRUE.equals(
+ model.getShowZeroBalanceAccounts()
+ .getValue())));
+ model.getShowZeroBalanceAccounts()
+ .setValue(App.getShowZeroBalanceAccounts());
+ }
+ @Override
+ public void onCreateOptionsMenu(@NotNull Menu menu, @NotNull MenuInflater inflater) {
+ inflater.inflate(R.menu.account_list, menu);
+
+ menuShowZeroBalances = menu.findItem(R.id.menu_account_list_show_zero_balances);
+ if ((menuShowZeroBalances == null))
+ throw new AssertionError();
+
+ menuShowZeroBalances.setOnMenuItemClickListener(menuItem -> {
+ model.getShowZeroBalanceAccounts()
+ .setValue(Boolean.FALSE.equals(model.getShowZeroBalanceAccounts()
+ .getValue()));
+ return true;
+ });
+
+ model.getShowZeroBalanceAccounts()
+ .observe(this, v -> {
+ menuShowZeroBalances.setChecked(v);
+ onProfileChanged(Data.getProfile(), v);
+ App.storeShowZeroBalanceAccounts(v);
+ });
+
+ super.onCreateOptionsMenu(menu, inflater);