I\'ve been using SwipeableRecyclerView for my android application for enabling swipes for my recyclerView. RecyclerView contains a list of cardViews.
I was trying to
Since I don't have enough reputation points to comment on @yigit's answer, I thought I would give a way to retrieve all viewHolders from a RecyclerView regardless of what is currently in the viewGroup. Even with findViewHolderForAdapterPosition and ForLayoutPosition we still can get a null instance of the ViewHolder in the RecyclerView.
To circumvent this, we can use findViewHolderForItemId[1] and pass the ID of the viewHolder in the adapter using RecyclerView.Adapter#getItemId(int position)[2]
for (int i = 0; i < mAdapter.getItemCount(); i++) {
RecyclerView.ViewHolder holder =
mRecyclerView.findViewHolderForItemId(mAdapter.getItemId(i));
}