debug("flow", "AccountSummaryFragment.onCreate()");
setHasOptionsMenu(true);
- Data.backgroundTasksRunning.observe(this, this::onBackgroundTaskRunningChanged);
+ Data.backgroundTasksRunning.observe(this.getViewLifecycleOwner(),
+ this::onBackgroundTaskRunningChanged);
}
public void onAttach(@NotNull Context context) {
super.onAttach(context);
manageFabOnScroll();
swiper = mActivity.findViewById(R.id.account_swiper);
- Colors.themeWatch.observe(this, this::themeChanged);
+ Colors.themeWatch.observe(getViewLifecycleOwner(), this::themeChanged);
swiper.setOnRefreshListener(() -> {
debug("ui", "refreshing accounts via swipe");
Data.scheduleTransactionListRetrieval(mActivity);
listAdapter = new NewTransactionItemsAdapter(viewModel, mProfile);
list.setAdapter(listAdapter);
list.setLayoutManager(new LinearLayoutManager(activity));
- Data.profile.observe(this, profile -> {
+ Data.profile.observe(getViewLifecycleOwner(), profile -> {
mProfile = profile;
listAdapter.setProfile(profile);
});
}).attachToRecyclerView(list);
viewModel.isSubmittable()
- .observe(this, isSubmittable -> {
+ .observe(getViewLifecycleOwner(), isSubmittable -> {
if (isSubmittable) {
if (fab != null) {
fab.show();
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
- Data.backgroundTasksRunning.observe(this, this::onBackgroundTaskRunningChanged);
+ Data.backgroundTasksRunning.observe(getViewLifecycleOwner(),
+ this::onBackgroundTaskRunningChanged);
}
@Override
public void onAttach(@NotNull Context context) {
Data.scheduleTransactionListRetrieval(mActivity);
});
- Colors.themeWatch.observe(this, this::themeChanged);
+ Colors.themeWatch.observe(getViewLifecycleOwner(), this::themeChanged);
vAccountFilter = mActivity.findViewById(R.id.transaction_list_account_name_filter);
accNameFilter = mActivity.findViewById(R.id.transaction_filter_account_name);
Globals.hideSoftKeyboard(mActivity);
});
- Data.accountFilter.observe(this, this::onAccountNameFilterChanged);
+ Data.accountFilter.observe(getViewLifecycleOwner(), this::onAccountNameFilterChanged);
TransactionListViewModel.updating.addObserver(
(o, arg) -> swiper.setRefreshing(TransactionListViewModel.updating.get()));