Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make Recycler View Inactive

I have a recycler view I'm using with a GridLayoutManager. When the user clicks on an item of view, a view is animatated with scale animation to display further details of the adapter item. I have a button to reverse this animation and remove the details off screen.

The problem is when the details view is displayed the user can still click on the recycler view and animate a different view. Can any tell me how to disable the recycler view?

I've tried rc_view.setEnabled(false); rc_view.setClickable(false);

and I've followed this and none of them has disabled the recycler view.

Can anyone help?

like image 283
DJ-DOO Avatar asked Jul 06 '15 12:07

DJ-DOO


2 Answers

Might sound stupid, but same thing happened to me on my menu (when clicking on open spaces the click events were passed to the recycler).

This was fixed by adding "clickable='true'" on the top view so it doesn't pass the click event to the recyclerview.

Let me know if this helps

like image 184
Smashing Avatar answered Sep 22 '22 08:09

Smashing


Use recyclerView.setClickable(true)

like image 38
Chirag Avatar answered Sep 22 '22 08:09

Chirag