kyze8439690 / ResideLayout

An Android Layout which has a same function like https://github.com/romaonthego/RESideMenu
Apache License 2.0
389 stars 86 forks source link

Disable ListView items click event in Relative Layout (balloon screen) #8

Closed charlesfranciscodev closed 8 years ago

charlesfranciscodev commented 8 years ago

When I click on the hidden list view items on the balloon screen, a toast is shown with the menu number that was selected. How can I disable click/touch events on the overlaying screen ?

charlesfranciscodev commented 8 years ago

In other words, where should I call listview.setEnabled(false); to disable the listview when the panel is in closed position (balloon screen) and this listview.setEnabled(true); to enable the listview when the panel is in open position (stars screen) It works in closePane() for disabling but not in openPane().

Where should I disable the listview ? In other words, which function is called when the panel is opened to show the stars screen with the lsit view ?

kyze8439690 commented 8 years ago

I have tried to implement the function you required but I failed. First of all, setEnabled() will cause UI change such as drawable state changed, if call setEnabled(false) when menu is invisible, it may cause some ui issue. And I can not decide whether to pass touch event to the menu or not because click event is a view internal function, I have to implement the whole click event detect system. There is two suggestion:

  1. You can put a click event block view (such as ListView) in the main ui, and it will block all click event if your finger is on it.
  2. If ListView is not you target solution, you can use PanelSlideListener to listen panel state change, and block OnItemClickListener in the menu.
charlesfranciscodev commented 8 years ago

Thanks for the help.