How can I access the item observer in the recycler view?

I have a recycler view that shows a list of images. I added an onScrollListener to this recycler.

Now that the scrolling is detected, I would like to set the image translation in viewers. So I need a link to the main holders.

How can I get them?

In code (it won't work, but you will get an idea of ​​what I want to achieve):

ImageView imageView = (ImageView) ((RecyclerFragmentAdapter.MyViewHolder) 
    mRecyclerView.getChildAt(i)).itemView.findViewById(R.id.imageView);
// ... Modify imageview, i.e. imageView.setImageMatrix(customImageMatrix);

      

+3


source to share


1 answer


RecyclerView.getChildViewHolder()
RecyclerView.findViewHolderForAdapterPosition()
RecyclerView.findViewHolderForLayoutPosition()

      



+5


source







All Articles