From 32479d6cca6ffb6b74edbd4b884b9062d42fcbff Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 28 Nov 2020 09:19:55 +0200 Subject: [PATCH] replace onActivityCreated (deprecated) with onViewCreated --- .../ui/account_summary/AccountSummaryFragment.java | 4 ++-- .../mobileledger/ui/activity/NewTransactionFragment.java | 4 ++-- .../mobileledger/ui/profiles/ProfileDetailFragment.java | 4 ++-- .../ui/transaction_list/TransactionListFragment.java | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java index 5f4ffe57..9654f140 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java @@ -67,9 +67,9 @@ public class AccountSummaryFragment extends MobileLedgerListFragment { @Override - public void onActivityCreated(@Nullable Bundle savedInstanceState) { + public void onViewCreated(@Nullable View view, @Nullable Bundle savedInstanceState) { debug("flow", "AccountSummaryFragment.onActivityCreated()"); - super.onActivityCreated(savedInstanceState); + super.onViewCreated(view, savedInstanceState); MainModel model = new ViewModelProvider(requireActivity()).get(MainModel.class); diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java index 05b272e8..e705d1c1 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java @@ -106,8 +106,8 @@ public class NewTransactionFragment extends Fragment { } @Override - public void onActivityCreated(@Nullable Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); + public void onViewCreated(@NotNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); FragmentActivity activity = getActivity(); if (activity == null) throw new RSInvalidStateException( diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java index 01c0143d..e4fa95ae 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java @@ -178,8 +178,8 @@ public class ProfileDetailFragment extends Fragment { }); } @Override - public void onActivityCreated(@Nullable Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); + public void onViewCreated(@NotNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); Activity context = getActivity(); if (context == null) return; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java index fdb54849..4ab877db 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java @@ -89,9 +89,9 @@ public class TransactionListFragment extends MobileLedgerListFragment debug("flow", "TransactionListFragment.onPause()"); } @Override - public void onActivityCreated(@Nullable Bundle savedInstanceState) { + public void onViewCreated(@NotNull View view, @Nullable Bundle savedInstanceState) { debug("flow", "TransactionListFragment.onActivityCreated called"); - super.onActivityCreated(savedInstanceState); + super.onViewCreated(view, savedInstanceState); Data.backgroundTasksRunning.observe(getViewLifecycleOwner(), this::onBackgroundTaskRunningChanged); @@ -129,7 +129,7 @@ public class TransactionListFragment extends MobileLedgerListFragment accNameFilter = mainActivity.findViewById(R.id.transaction_filter_account_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() -- 2.39.5