modelAdapter = new AccountSummaryAdapter(model);
MainActivity mainActivity = getMainActivity();
- root = mainActivity.findViewById(R.id.account_root);
+ root = view.findViewById(R.id.account_root);
LinearLayoutManager llm = new LinearLayoutManager(mainActivity);
llm.setOrientation(RecyclerView.VERTICAL);
root.setLayoutManager(llm);
manageFabOnScroll();
- refreshLayout = mainActivity.findViewById(R.id.account_swipe_refresh_layout);
+ refreshLayout = view.findViewById(R.id.account_swipe_refresh_layout);
Colors.themeWatch.observe(getViewLifecycleOwner(), this::themeChanged);
refreshLayout.setOnRefreshListener(() -> {
debug("ui", "refreshing accounts via swipe");
model = new ViewModelProvider(requireActivity()).get(MainModel.class);
- refreshLayout = mainActivity.findViewById(R.id.transaction_swipe);
+ refreshLayout = view.findViewById(R.id.transaction_swipe);
if (refreshLayout == null)
throw new RuntimeException("Can't get hold on the swipe layout");
- root = mainActivity.findViewById(R.id.transaction_root);
+ root = view.findViewById(R.id.transaction_root);
if (root == null)
throw new RuntimeException("Can't get hold on the transaction value view");
modelAdapter = new TransactionListAdapter(model);
Colors.themeWatch.observe(getViewLifecycleOwner(), this::themeChanged);
- vAccountFilter = mainActivity.findViewById(R.id.transaction_list_account_name_filter);
- accNameFilter = mainActivity.findViewById(R.id.transaction_filter_account_name);
+ vAccountFilter = view.findViewById(R.id.transaction_list_account_name_filter);
+ accNameFilter = view.findViewById(R.id.transaction_filter_account_name);
MLDB.hookAutocompletionAdapter(mainActivity, accNameFilter, "accounts", "name");
accNameFilter.setOnItemClickListener((parent, v, position, id) -> {
model.getDisplayedTransactions()
.observe(getViewLifecycleOwner(), list -> modelAdapter.setTransactions(list));
- mainActivity.findViewById(R.id.clearAccountNameFilter)
- .setOnClickListener(v -> {
+ view.findViewById(R.id.clearAccountNameFilter)
+ .setOnClickListener(v -> {
model.getAccountFilter()
.setValue(null);
vAccountFilter.setVisibility(View.GONE);