Use getBindingAdapterPosition() instead of getAdapterPosition()

This commit is contained in:
CappielloAntonio 2021-04-12 14:51:25 +02:00
parent bbba68bc70
commit 41c04ab302
17 changed files with 39 additions and 41 deletions

View file

@ -71,14 +71,14 @@ public class ArtistAdapter extends RecyclerView.Adapter<ArtistAdapter.ViewHolder
@Override
public void onClick(View view) {
Bundle bundle = new Bundle();
bundle.putParcelable("artist_object", artists.get(getAdapterPosition()));
bundle.putParcelable("artist_object", artists.get(getBindingAdapterPosition()));
Navigation.findNavController(view).navigate(R.id.action_libraryFragment_to_artistPageFragment, bundle);
}
@Override
public boolean onLongClick(View v) {
Bundle bundle = new Bundle();
bundle.putParcelable("artist_object", artists.get(getAdapterPosition()));
bundle.putParcelable("artist_object", artists.get(getBindingAdapterPosition()));
Navigation.findNavController(v).navigate(R.id.artistBottomSheetDialog, bundle);
return true;
}