Browse Source

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 years ago
parent
commit
518808a89d

+ 0
- 8
lib/android/app/src/main/java/com/reactnativenavigation/parse/Options.java View File

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

+ 0
- 3
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuController.java View File

96
     public void mergeChildOptions(Options options, ViewController child) {
96
     public void mergeChildOptions(Options options, ViewController child) {
97
         super.mergeChildOptions(options, child);
97
         super.mergeChildOptions(options, child);
98
         presenter.mergeChildOptions(options.sideMenuRootOptions);
98
         presenter.mergeChildOptions(options.sideMenuRootOptions);
99
-        performOnParentController(parentController ->
100
-                ((ParentController) parentController).mergeChildOptions(options.copy().clearSideMenuOptions(), child)
101
-        );
102
     }
99
     }
103
 
100
 
104
     @Override
101
     @Override

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

19
             Log.w("RNN", "Tried to open sideMenu, but it's not defined");
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
 }