I am looking for a way to disable gesture to slide in the sidedrawer (as I want to open the drawer with a button in the action-bar only), however I still want to allow user to dismiss the sidedrawer with the standard gesture.
Currently I can either disable gestures completely with gesturesEnabled or have gestures active for to open and close.
Would it be possible to change gesturesEnabled or add another property that would take values like:
all, openonly, closeonly, none
This is a valid point actually and I'm interested in the same options too. Is there any workaround/hack to achieve what @sebawita asking for?
@terreb, @sebawita - can you try with gesturesEnabled="false" and hooking the touch or tap event on the main content's root element where you can close the drawer programmatically?
@ginev, hmm, that's a good idea, thank you!
@ginev, ok I added a listener for pan event and then see whether the user is dragging left (I have the drawer on the left side, so if deltaX<0 and Math.abs(deltaY) <20 I assume it's left draging) if true I close the drawer. It works but sure this is not the same as when gestures are enabled for the drawer. Sometimes it's sliding out smoothly, sometimes animation stops in the middle and it just disappears. I would say this is still a hack and not a real solution:) Would still be nice if you guys implement disabling/enabling gestures separately for opening and closing.
@terreb - that's a valid point. I will open an issue in our internal repository and will schedule this for implementation.
@ginev, thanks a lot man!
Is it possible to use binding or expressions in XML files like this gesturesEnabled="{{ 'false' }}"?
Or how dynamically control gesturesEnabled state?
@webleaf @terreb @sebawita
Hey guys, with version 4.2.0 you can set allowEdgeSwipe="false", if you want to disable side drawer open gesture. Other gestures will continue to work in this case. Let us know if you have any other issues/feature requests.
Most helpful comment
@webleaf @terreb @sebawita
Hey guys, with version 4.2.0 you can set
allowEdgeSwipe="false", if you want to disable side drawer open gesture. Other gestures will continue to work in this case. Let us know if you have any other issues/feature requests.