user12426457
user12426457

Reputation:

how to disable clicks under android constraintlayout

I have an activity layout which had reyclerview list and on click on filter button another layout opens above it but the problem is when click on white space on the filter layout it make click on the hidden item in the recyclerview which hidden under it so how can I make no action happens on clicking on white space on the filter layout

Upvotes: 4

Views: 4782

Answers (3)

raj kavadia
raj kavadia

Reputation: 1073

Try these line

constrainlayout.setenabled(false);

Upvotes: 1

Mahmoud Abu Alheja
Mahmoud Abu Alheja

Reputation: 3668

try to add this atrr to your group layout constraintlayout your top layer parent

android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"

this atrr will make your layout(Top) click able and avoid click white space to bottom layout

-- hope this help

Upvotes: 2

can you show the xml file for more info? first put the recycler view under the filter layout. after that set filter layout visibility to gone. when filter button clicked, set filter layout visibility from gone to visible. your recycler view must be under filter layout in visible mode

Upvotes: 0

Related Questions