{"action":"created","issue":{"url":"https://api.github.com/repos/neokree/MaterialNavigationDrawer/issues/62","labels_url":"https://api.github.com/repos/neokree/MaterialNavigationDrawer/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/neokree/MaterialNavigationDrawer/issues/62/comments","events_url":"https://api.github.com/repos/neokree/MaterialNavigationDrawer/issues/62/events","html_url":"https://github.com/neokree/MaterialNavigationDrawer/issues/62","id":53027952,"number":62,"title":"cannot touch in content in DrawerLayout.LOCK_MODE_LOCKED_OPEN","user":{"login":"ht1990","id":7005711,"avatar_url":"https://avatars.githubusercontent.com/u/7005711?v=3","gravatar_id":"","url":"https://api.github.com/users/ht1990","html_url":"https://github.com/ht1990","followers_url":"https://api.github.com/users/ht1990/followers","following_url":"https://api.github.com/users/ht1990/following{/other_user}","gists_url":"https://api.github.com/users/ht1990/gists{/gist_id}","starred_url":"https://api.github.com/users/ht1990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ht1990/subscriptions","organizations_url":"https://api.github.com/users/ht1990/orgs","repos_url":"https://api.github.com/users/ht1990/repos","events_url":"https://api.github.com/users/ht1990/events{/privacy}","received_events_url":"https://api.github.com/users/ht1990/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/neokree/MaterialNavigationDrawer/labels/work+in+progress","name":"work in progress","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2014-12-29T09:00:58Z","updated_at":"2015-01-04T12:51:43Z","closed_at":null,"body":"in tablet 7-inch landscape or larger device, you setDrawerLockMode, so you can't touch in content.\r\nI think this is solution:\r\nhttp://derekrwoods.com/2013/09/creating-a-static-navigation-drawer-in-android/\r\nI tried and it work for me."},"comment":{"url":"https://api.github.com/repos/neokree/MaterialNavigationDrawer/issues/comments/68631809","html_url":"https://github.com/neokree/MaterialNavigationDrawer/issues/62#issuecomment-68631809","issue_url":"https://api.github.com/repos/neokree/MaterialNavigationDrawer/issues/62","id":68631809,"user":{"login":"rburgst","id":22971,"avatar_url":"https://avatars.githubusercontent.com/u/22971?v=3","gravatar_id":"","url":"https://api.github.com/users/rburgst","html_url":"https://github.com/rburgst","followers_url":"https://api.github.com/users/rburgst/followers","following_url":"https://api.github.com/users/rburgst/following{/other_user}","gists_url":"https://api.github.com/users/rburgst/gists{/gist_id}","starred_url":"https://api.github.com/users/rburgst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rburgst/subscriptions","organizations_url":"https://api.github.com/users/rburgst/orgs","repos_url":"https://api.github.com/users/rburgst/repos","events_url":"https://api.github.com/users/rburgst/events{/privacy}","received_events_url":"https://api.github.com/users/rburgst/received_events","type":"User","site_admin":false},"created_at":"2015-01-04T12:51:43Z","updated_at":"2015-01-04T12:51:43Z","body":"I fixed the issue in the following manner \r\n\r\n1. I subclassed DrawerLayout to stop intercepting touch events\r\n\r\n\r\n        package com.burgstaller.android.focusgtd.ui.widgets;\r\n\r\n        import android.content.Context;\r\n        import android.support.v4.widget.DrawerLayout;\r\n        import android.util.AttributeSet;\r\n        import android.view.MotionEvent;\r\n\r\n        /**\r\n         * An improved version of DrawerLayout that will ensure that a locked open DrawerLayout can be used without capturing all touches into the client\r\n         * area.\r\n         * <p>\r\n         *     To activate, call {@link #requestDisallowInterceptTouchEvent(boolean)} on the layout. Note that this should only ever be done in case when\r\n         *     the drawer is to be locked open.\r\n         * </p>\r\n         * @author Rainer Burgstaller\r\n         */\r\n        public class BetterDrawerLayout extends DrawerLayout {\r\n            private boolean m_disallowIntercept;\r\n\r\n            public BetterDrawerLayout(final Context context) {\r\n                super(context);\r\n            }\r\n\r\n            public BetterDrawerLayout(final Context context, final AttributeSet attrs) {\r\n                super(context, attrs);\r\n            }\r\n\r\n            public BetterDrawerLayout(final Context context, final AttributeSet attrs, final int defStyle) {\r\n                super(context, attrs, defStyle);\r\n            }\r\n\r\n            @Override\r\n            public boolean onInterceptTouchEvent(final MotionEvent ev) {\r\n                if (m_disallowIntercept) {\r\n                    return false;\r\n                }\r\n                return super.onInterceptTouchEvent(ev);\r\n            }\r\n\r\n            @Override\r\n            public void requestDisallowInterceptTouchEvent(final boolean disallowIntercept) {\r\n                super.requestDisallowInterceptTouchEvent(disallowIntercept);\r\n\r\n                m_disallowIntercept = disallowIntercept;\r\n            }\r\n        }\r\n\r\n2. then you only need to replace the drawer layout in `activity_material_navigation_drawer.xml`\r\n\r\n        <com.burgstaller.android.focusgtd.ui.widgets.BetterDrawerLayout\r\n            xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n            android:id=\"@+id/drawer_layout\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:fitsSystemWindows=\"false\" >\r\n\r\n            <!-- Framelayout per la visualizzazione -->\r\n            <RelativeLayout\r\n                android:id=\"@+id/content\"\r\n       ...\r\n\r\n        </com.burgstaller.android.focusgtd.ui.widgets.BetterDrawerLayout>\r\n\r\n3. finally you need to call `layout.requestDisallowInterceptTouchEvent(true)` in `MaterialNavigationDrawer#onCreate`\r\n\r\n\r\n        if(deviceSupportMultiPane()) {\r\n            // se il multipane e' attivo, si e' in landscape e si e' un tablet allora si passa in multipane mode\r\n            layout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN,drawer);\r\n            DrawerLayout.LayoutParams params = new DrawerLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);\r\n            params.setMargins((int) (320 * density),0,0,0);\r\n            content.setLayoutParams(params);\r\n            layout.setScrimColor(Color.TRANSPARENT);\r\n            layout.openDrawer(drawer);\r\n            layout.requestDisallowInterceptTouchEvent(true);\r\n        }\r\n\r\n\r\nIf you don't want to change the original source code you can grab a reference to the DrawerLayout in your Activity.init() method and call `layout.requestDisallowInterceptTouchEvent(true)` there."}}