* {@link OnNewTransactionFragmentInteractionListener} interface
* to handle interaction events.
*/
+
+// TODO: offer to undo account remove-on-swipe
+
public class NewTransactionFragment extends Fragment {
private NewTransactionItemsAdapter listAdapter;
private NewTransactionModel viewModel;
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();
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();