DJ-DOO
DJ-DOO

Reputation: 4781

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?

Upvotes: 5

Views: 7529

Answers (2)

Chirag
Chirag

Reputation: 967

Use recyclerView.setClickable(true)

Upvotes: 2

Smashing
Smashing

Reputation: 1710

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

Upvotes: 6

Related Questions