]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java
drop unused code
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / NewTransactionFragment.java
index 5cbbab71f5cb86c71ec23073437d2723e191972d..9d24f63ed3e960a4d8a66ffaeba8734b9adb699e 100644 (file)
@@ -98,7 +98,7 @@ public class NewTransactionFragment extends Fragment {
         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);
         });
@@ -142,7 +142,7 @@ public class NewTransactionFragment extends Fragment {
         }).attachToRecyclerView(list);
 
         viewModel.isSubmittable()
-                 .observe(this, isSubmittable -> {
+                 .observe(getViewLifecycleOwner(), isSubmittable -> {
                      if (isSubmittable) {
                          if (fab != null) {
                              fab.show();
@@ -166,7 +166,6 @@ public class NewTransactionFragment extends Fragment {
         if (args != null) {
             String error = args.getString("error");
             if (error != null) {
-                // TODO display error
                 Logger.debug("new-trans-f", String.format("Got error: %s", error));
                 Snackbar.make(list, error, Snackbar.LENGTH_LONG)
                         .show();