]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java
fix a bunch of spelling mistakes all around
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / NewTransactionFragment.java
index e4ac7792eaa7579aa5ec756b909ef1913a9e8b53..9f69644436b000eb316afebad568bc554ba2b795 100644 (file)
@@ -114,14 +114,14 @@ public class NewTransactionFragment extends Fragment {
             throw new RSInvalidStateException(
                     "getActivity() returned null within onActivityCreated()");
 
-        list = activity.findViewById(R.id.new_transaction_accounts);
         viewModel = new ViewModelProvider(activity).get(NewTransactionModel.class);
         viewModel.observeDataProfile(this);
-        mProfile = Data.profile.getValue();
+        mProfile = Data.getProfile();
         listAdapter = new NewTransactionItemsAdapter(viewModel, mProfile);
         list.setAdapter(listAdapter);
         list.setLayoutManager(new LinearLayoutManager(activity));
-        Data.profile.observe(getViewLifecycleOwner(), profile -> {
+
+        Data.observeProfile(getViewLifecycleOwner(), profile -> {
             mProfile = profile;
             listAdapter.setProfile(profile);
         });
@@ -131,7 +131,6 @@ public class NewTransactionFragment extends Fragment {
                      if (isSubmittable) {
                          if (fab != null) {
                              fab.show();
-                             fab.setEnabled(true);
                          }
                      }
                      else {
@@ -179,7 +178,7 @@ public class NewTransactionFragment extends Fragment {
 //                        p.setVisibility(View.VISIBLE);
 //
 //                }, 10);
-                        p.setVisibility(View.VISIBLE);
+                p.setVisibility(View.VISIBLE);
             }
             else
                 p.setVisibility(View.INVISIBLE);
@@ -193,7 +192,7 @@ public class NewTransactionFragment extends Fragment {
         outState.putInt("focused", focusedItem);
     }
     private void onFabPressed() {
-        fab.setEnabled(false);
+        fab.hide();
         Misc.hideSoftKeyboard(this);
         if (mListener != null) {
             SimpleDate date = viewModel.getDate();