0

I have an application where I used both DrawerLayout and Google Maps. As I wished, I disabled the swipe gesture for the drawer, setting this flag:

drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);

It worked like a charm, but I also lost touch event on Maps which is situated behind my drawer...

Is there any way to achieve a locked Drawer and also focus to Maps at the same time, responding to my scroll, zooming, etc.?

Any suggestion is appreciated.

EDIT: Here's the layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".HomeActivity" >

    <android.support.v4.widget.DrawerLayout
        android:id="@+id/drawer_left_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <FrameLayout
            android:id="@+id/main_fragment_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:padding="80dp" />

        <FrameLayout
            android:id="@+id/fragment_drawer_left_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="start" />

   </android.support.v4.widget.DrawerLayout>

   <android.support.v4.widget.DrawerLayout
        android:id="@+id/drawer_right_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <FrameLayout
            android:id="@+id/fragment_drawer_right_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="end" />
   </android.support.v4.widget.DrawerLayout>

</RelativeLayout>
Zsolt Boldizsar
  • 2,447
  • 2
  • 27
  • 37
  • Did you lose all touch events, or only ones starting near the edge where the drawer is? – CommonsWare Dec 02 '13 at 15:40
  • @CommonsWare Yes, it seems that I lost all touch events. I also tried to add a button, and neither the button could be accessed no more. – Zsolt Boldizsar Dec 02 '13 at 16:01
  • That's rather strange. Could you post the layout where you are using `DrawerLayout`? – CommonsWare Dec 02 '13 at 16:18
  • Using two instances of `DrawerLayout` seems odd. Check out: http://stackoverflow.com/questions/17861755/drawerlayout-double-drawer-left-and-right-drawers-simultaneously – CommonsWare Dec 02 '13 at 17:08
  • Thanks for pointing that out, but how would that approach solve my problem anyway? I also read in one of your comments on a different thread that it's not too good to disable the swipe functionality of the `DrawerLayout`. But I would like to activate the navigation only by the two buttons situated on the very left and right of an actionbar. Should I use something else instead? – Zsolt Boldizsar Dec 02 '13 at 17:56
  • "Thanks for pointing that out, but how would that approach solve my problem anyway?" -- because I don't know if two `DrawerLayout` widgets can co-exist properly. "I also read in one of your comments on a different thread that it's not too good to disable the swipe functionality of the DrawerLayout." -- I don't recall saying that. Personally I wish `DrawerLayout` didn't use a swipe gesture in the first place, as we are seriously overloading horizontal swiping now in Android. – CommonsWare Dec 02 '13 at 18:30
  • @CommonsWare Yeah you're right about that other thread, I sincerely read that in a real hurry, and you were telling that it's not a good idea to disable swipe for just one of the functions of the drawer(open/close). Sorry that I mentioned that even if it was a totally different topic. – Zsolt Boldizsar Dec 03 '13 at 17:54

0 Answers0