X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Factivity%2FNewTransactionFragment.java;h=e705d1c102df4a01348d77b57ac118806e4fc13d;hb=32479d6cca6ffb6b74edbd4b884b9062d42fcbff;hp=e54e8d6115af6c42c6b07b7020263613b0f7d827;hpb=47e8d44c9633c88fec1c3802157927652fe62e53;p=mobile-ledger.git 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 e54e8d61..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 @@ -63,7 +63,6 @@ import org.jetbrains.annotations.NotNull; public class NewTransactionFragment extends Fragment { private NewTransactionItemsAdapter listAdapter; private NewTransactionModel viewModel; - private RecyclerView list; private FloatingActionButton fab; private OnNewTransactionFragmentInteractionListener mListener; private MobileLedgerProfile mProfile; @@ -107,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( @@ -116,11 +115,14 @@ public class NewTransactionFragment extends Fragment { viewModel = new ViewModelProvider(activity).get(NewTransactionModel.class); viewModel.observeDataProfile(this); - mProfile = Data.profile.getValue(); + mProfile = Data.getProfile(); listAdapter = new NewTransactionItemsAdapter(viewModel, mProfile); + + RecyclerView list = activity.findViewById(R.id.new_transaction_accounts); list.setAdapter(listAdapter); list.setLayoutManager(new LinearLayoutManager(activity)); - Data.profile.observe(getViewLifecycleOwner(), profile -> { + + Data.observeProfile(getViewLifecycleOwner(), profile -> { mProfile = profile; listAdapter.setProfile(profile); });