I implemented a SwipeRefreshLayout
using a RecyclerView
and I need that my adapter items are disabled during the OnRefreshListener
.
I tried the following approach, but the click occurs normally:
mRecyclerView.setEnabled(false);
mRecyclerView.setClickable(false);
Use logic we had with
ListAdapter
. This will disable adapter items, instead their parent.And implementation should look like this:
Usage:
mRecylerAdapter.setAllItemsEnabled(!mSwipeRefreshLayout.isRefreshing());