소스 검색

Set SideMenu lockMode only if needed

Apparently lockMode conflicts with visibility - If a menu is visible and lockMode locked is applied the menu closes.
Also removed temp code related to workaround introduced for temp sideMenu options (visibility)
Guy Carmeli 5 년 전
부모
커밋
518808a89d

+ 0
- 8
lib/android/app/src/main/java/com/reactnativenavigation/parse/Options.java 파일 보기

@@ -1,6 +1,5 @@
1 1
 package com.reactnativenavigation.parse;
2 2
 
3
-import com.reactnativenavigation.parse.params.NullBool;
4 3
 import com.reactnativenavigation.parse.params.NullNumber;
5 4
 import com.reactnativenavigation.parse.params.NullText;
6 5
 import com.reactnativenavigation.utils.TypefaceLoader;
@@ -131,11 +130,6 @@ public class Options {
131 130
         return this;
132 131
     }
133 132
 
134
-    public Options clearSideMenuOptions() {
135
-        sideMenuRootOptions = new SideMenuRootOptions();
136
-        return this;
137
-    }
138
-
139 133
     public Options clearAnimationOptions() {
140 134
         animations = new AnimationsOptions();
141 135
         return this;
@@ -147,8 +141,6 @@ public class Options {
147 141
     }
148 142
 
149 143
     public Options clearOneTimeOptions() {
150
-        sideMenuRootOptions.left.visible = new NullBool();
151
-        sideMenuRootOptions.right.visible = new NullBool();
152 144
         bottomTabsOptions.currentTabId = new NullText();
153 145
         bottomTabsOptions.currentTabIndex = new NullNumber();
154 146
         return this;

+ 0
- 3
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuController.java 파일 보기

@@ -96,9 +96,6 @@ public class SideMenuController extends ParentController<SideMenuRoot> implement
96 96
     public void mergeChildOptions(Options options, ViewController child) {
97 97
         super.mergeChildOptions(options, child);
98 98
         presenter.mergeChildOptions(options.sideMenuRootOptions);
99
-        performOnParentController(parentController ->
100
-                ((ParentController) parentController).mergeChildOptions(options.copy().clearSideMenuOptions(), child)
101
-        );
102 99
     }
103 100
 
104 101
     @Override

+ 6
- 0
lib/android/app/src/main/java/com/reactnativenavigation/views/SideMenu.java 파일 보기

@@ -19,4 +19,10 @@ public class SideMenu extends DrawerLayout {
19 19
             Log.w("RNN", "Tried to open sideMenu, but it's not defined");
20 20
         }
21 21
     }
22
+
23
+    @Override
24
+    public void setDrawerLockMode(int lockMode, int edgeGravity) {
25
+        int currentLockMode = getDrawerLockMode(edgeGravity);
26
+        if (currentLockMode != lockMode) super.setDrawerLockMode(lockMode, edgeGravity);
27
+    }
22 28
 }