Disable Clicks On Entire Recyclerview
I want to disable clicks on the entire RecyclerView once an item of it is clicked and enable it back again after suppose 500 milis. The idea is just to prevent multiple rapid click
Solution 1:
May be you have to disable all the children of the RecyclerView. You can do it like this:
privatestaticvoidsetViewAndChildrenEnabled(View view, boolean enabled) {
view.setEnabled(enabled);
if (view instanceof ViewGroup) {
ViewGroupviewGroup= (ViewGroup) view;
for (inti=0; i < viewGroup.getChildCount(); i++) {
Viewchild= viewGroup.getChildAt(i);
setViewAndChildrenDisabled(child, enabled);
}
}
}
Where parameter view
is your RecyclerView.
Post a Comment for "Disable Clicks On Entire Recyclerview"