Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- reusableRecyclerView = new ReusableView<>(view.findViewById(R.id.transactionsBox));
- LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
- // reusableRecyclerView.get().setLayoutManager(layoutManager);
- NavController navController = Navigation.findNavController(view); // get this now
- TransactionsAdapter.OnClickTransaction onClickTransaction = transaction -> {
- //TODO Navigation al dettaglio della transazione
- };
- adapter = new TransactionsAdapter(getContext(), onClickTransaction);
- reusableRecyclerView.get().setAdapter(adapter);
- if(userViewModel.getCurrentCard() != null) {
- userViewModel.getMovements(userViewModel.getCurrentCard().getId().toString()).observe(getViewLifecycleOwner(), new Observer<PagedList<TransactionRefactor>>() {
- @Override
- public void onChanged(PagedList<TransactionRefactor> transactionRefactors) {
- adapter.submitList(transactionRefactors);
- }
- });
- userViewModel.getMovementsLoadingStatus().observe(getViewLifecycleOwner(), new Observer<Resource>() {
- @Override
- public void onChanged(Resource resource) {
- setLoaderVisibility(resource, this);
- if (resource.status == Status.ERROR) {
- Toast.makeText(getContext(), "Al momento non è possibile recuperare le transazioni", Toast.LENGTH_LONG).show();
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement