SHARE
TWEET

Untitled

a guest Jan 24th, 2020 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. reusableRecyclerView = new ReusableView<>(view.findViewById(R.id.transactionsBox));
  2.             LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
  3.            // reusableRecyclerView.get().setLayoutManager(layoutManager);
  4.  
  5.  
  6.             NavController navController = Navigation.findNavController(view); // get this now
  7.             TransactionsAdapter.OnClickTransaction onClickTransaction = transaction -> {
  8.  
  9.                 //TODO Navigation al dettaglio della transazione
  10.             };
  11.             adapter = new TransactionsAdapter(getContext(), onClickTransaction);
  12.             reusableRecyclerView.get().setAdapter(adapter);
  13.  
  14.  
  15.  
  16.         if(userViewModel.getCurrentCard() != null) {
  17.             userViewModel.getMovements(userViewModel.getCurrentCard().getId().toString()).observe(getViewLifecycleOwner(), new Observer<PagedList<TransactionRefactor>>() {
  18.                 @Override
  19.                 public void onChanged(PagedList<TransactionRefactor> transactionRefactors) {
  20.                     adapter.submitList(transactionRefactors);
  21.                 }
  22.             });
  23.  
  24.             userViewModel.getMovementsLoadingStatus().observe(getViewLifecycleOwner(), new Observer<Resource>() {
  25.                 @Override
  26.                 public void onChanged(Resource resource) {
  27.                     setLoaderVisibility(resource, this);
  28.                     if (resource.status == Status.ERROR) {
  29.                         Toast.makeText(getContext(), "Al momento non รจ possibile recuperare le transazioni", Toast.LENGTH_LONG).show();
  30.                     }
  31.                 }
  32.             });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top