How to make active main content area, while drawer is open. Currently, if main content area is clicked, drawer will be closed then touch event will be dropped, I want to catch that touch event and pass it to main content area.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I solved my problem with temporarily solution, not so elegant, but does the job for a while, maybe contains side effects. I always return
false
in onInterceptTouchEvent() call and everything is active everytime.You need to create custom DrawerLayout and @overide
onInterceptTouchEvent
. Then you can create some method for registering drawer views (likesetDrawerViewWithoutIntercepting
), for which will be possible to use (click) main content, when are open. You should call this method in your activity/fragment, where is this DrawerLayout used.OnInterceptTouchEvent will be returning false just in case registered drawer view is opened and touches are outside of drawer view area. This means all functionality remains the same (like closing drawer view using swiping, etc.)
This is just example which should be improved, so I hope it will help you.