I have an Activity
which uses the Android NavigationDrawer
.
When using only fragment
s (as usual), everything works perfect.
But now I want to use this drawer
on other activities of my app, and for some of them,
I don't want the main view to be a fragment
.
Question
The problem is, the onTouchEvent()
of the activity
itself (and the onItemClickedListener()
of a child ListView
for that matter) isn't called, because the drawer
consumes it.
Of course, I want it to be called:)
Needless to say, I would hope the answer will be simple (even a XML one), and hopefully not by extending the Drawer
class (unless that's what it takes of course).
More Info
The Activity's main layout is very simple, basically a ListView
and the DrawerLayout
on top of it (below in XML).
The Drawer
has one fragment
as it's childView
(for fragment navigation) and of course, the ListView
for the Drawer
Items.
I've seen many questions regarding (not exactly) similar issues, and the frequent answer was to use onInterceptTouch()
, requestDisallowInterceptTouchEvent()
on the DrawerLayout
, and on the Parent view (Activity
's main content) and even onTouchEvent()
(with False returned) on the ListView
of the Drawer.
Nothing seems to do the trick.
I read this link
and it does seem like using Intercept methods somewhere could be the answer. But how?
Please let me know if you need any code. But it's a very basic code/layout for this matter.
Thanks!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With