I have got a recycler view that shows a list of images. I have added an onScrollListener to that recycler view.
Now, when a scroll is detected, I would like to set the translation of the imageviews in the viewholders. Therefore I need a reference to the underlying view holders.
How can I get those?
In code (this won't work, but you will get the idea 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);
RecyclerView.getChildViewHolder()
RecyclerView.findViewHolderForAdapterPosition()
RecyclerView.findViewHolderForLayoutPosition()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With