import static android.content.Context.INPUT_METHOD_SERVICE;
import static net.ktnx.mobileledger.utils.Logger.debug;
import static android.content.Context.INPUT_METHOD_SERVICE;
import static net.ktnx.mobileledger.utils.Logger.debug;
public class TransactionListFragment extends MobileLedgerListFragment
implements DatePickerFragment.DatePickedListener {
private MenuItem menuTransactionListFilter;
public class TransactionListFragment extends MobileLedgerListFragment
implements DatePickerFragment.DatePickedListener {
private MenuItem menuTransactionListFilter;
Data.backgroundTasksRunning.observe(getViewLifecycleOwner(),
this::onBackgroundTaskRunningChanged);
Data.backgroundTasksRunning.observe(getViewLifecycleOwner(),
this::onBackgroundTaskRunningChanged);
if (root == null)
throw new RuntimeException("Can't get hold on the transaction value view");
modelAdapter = new TransactionListAdapter(model);
if (root == null)
throw new RuntimeException("Can't get hold on the transaction value view");
modelAdapter = new TransactionListAdapter(model);
- 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");
MLDB.hookAutocompletionAdapter(mainActivity, accNameFilter, "accounts", "name");
- accNameFilter.setOnItemClickListener((parent, view, position, id) -> {
+ accNameFilter.setOnItemClickListener((parent, v, position, id) -> {
// debug("tmp", "direct onItemClick");
Cursor c = (Cursor) parent.getItemAtPosition(position);
model.getAccountFilter()
// debug("tmp", "direct onItemClick");
Cursor c = (Cursor) parent.getItemAtPosition(position);
model.getAccountFilter()
model.getDisplayedTransactions()
.observe(getViewLifecycleOwner(), list -> modelAdapter.setTransactions(list));
model.getDisplayedTransactions()
.observe(getViewLifecycleOwner(), list -> modelAdapter.setTransactions(list));