- swiper.setColorSchemeResources(R.color.colorPrimary, R.color.colorAccent);
-
- vAccountFilter = mActivity.findViewById(R.id.transaction_list_account_name_filter);
- accNameFilter = mActivity.findViewById(R.id.transaction_filter_account_name);
-
- TransactionListFragment me = this;
- MLDB.hook_autocompletion_adapter(mActivity, accNameFilter, "accounts", "name");
- accNameFilter.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- Log.d("tmp", "direct onItemClick");
- ((TransactionListViewModel) model).scheduleTransactionListReload(mActivity);
- MatrixCursor mc = (MatrixCursor) parent.getItemAtPosition(position);
- modelAdapter.setBoldAccountName(mc.getString(1));
- modelAdapter.notifyDataSetChanged();
- Globals.hideSoftKeyboard(mActivity);
- }
- });
+ model.getAccountFilter()
+ .observe(getViewLifecycleOwner(), this::onAccountNameFilterChanged);