Browse Source

Implement disableOpenGesture on Android

fixes #309
Guy Carmeli 8 years ago
parent
commit
3728569c2b

+ 7
- 0
android/app/src/main/java/com/reactnativenavigation/views/SideMenu.java View File

57
         super(context);
57
         super(context);
58
         createContentContainer();
58
         createContentContainer();
59
         createSideMenu(sideMenuParams);
59
         createSideMenu(sideMenuParams);
60
+        setStyle(sideMenuParams);
60
     }
61
     }
61
 
62
 
62
     private void createContentContainer() {
63
     private void createContentContainer() {
72
         lp.gravity = Gravity.START;
73
         lp.gravity = Gravity.START;
73
         addView(sideMenuView, lp);
74
         addView(sideMenuView, lp);
74
     }
75
     }
76
+
77
+    private void setStyle(SideMenuParams params) {
78
+        if (params.disableOpenGesture) {
79
+            setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
80
+        }
81
+    }
75
 }
82
 }