views:

292

answers:

2

I have a SlidingDrawer that pops up from the bottom of the screen and fills the screen about 80%. Even though the SlidingDrawer view is in focus, it is still possible to click on items, buttons and other elements in the view that is behind the SlidingDrawer. When SlidingDrawer is active/pulled up/in focus, I want to disable the entire view behind it so it will not be able to recieve clicks and touches. Is there a good way to disable an entire view? I have tried setEnable(false) and setClickable(false) but neither of them work.

Help?

A: 

I don't know if this will work, but it's worth a try. Call setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS) on your container View (the one that the sliding drawer slides over).

synic
@Sara, please let us know if it works.
tomash
+1  A: 

Here's a way to get around this problem (I needed a solution also) - grab the linearLayout that holds the contents and add a click listener. Have the click listener respond to clicks (throw away, whatever) - and this then stops it propagating to the view below the sliding drawer - it works for me - and it doesn't block the other items in the drawer.

Joe...