Browse Source

Send sideMenu button press event when drawer not defined

fixes #274
Guy Carmeli 8 years ago
parent
commit
62877cf47c

+ 4
- 0
android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java View File

7
 import android.widget.RelativeLayout;
7
 import android.widget.RelativeLayout;
8
 
8
 
9
 import com.aurelhubert.ahbottomnavigation.AHBottomNavigation;
9
 import com.aurelhubert.ahbottomnavigation.AHBottomNavigation;
10
+import com.reactnativenavigation.NavigationApplication;
10
 import com.reactnativenavigation.params.ActivityParams;
11
 import com.reactnativenavigation.params.ActivityParams;
11
 import com.reactnativenavigation.params.ScreenParams;
12
 import com.reactnativenavigation.params.ScreenParams;
12
 import com.reactnativenavigation.params.SideMenuParams;
13
 import com.reactnativenavigation.params.SideMenuParams;
332
     public void onSideMenuButtonClick() {
333
     public void onSideMenuButtonClick() {
333
         if (sideMenu != null) {
334
         if (sideMenu != null) {
334
             sideMenu.openDrawer();
335
             sideMenu.openDrawer();
336
+        } else {
337
+            final String navigatorEventId = getCurrentScreenStack().peek().getNavigatorEventId();
338
+            NavigationApplication.instance.sendNavigatorEvent("sideMenu", navigatorEventId);
335
         }
339
         }
336
     }
340
     }
337
 }
341
 }

+ 4
- 0
android/app/src/main/java/com/reactnativenavigation/layouts/SingleScreenLayout.java View File

5
 import android.view.View;
5
 import android.view.View;
6
 import android.widget.RelativeLayout;
6
 import android.widget.RelativeLayout;
7
 
7
 
8
+import com.reactnativenavigation.NavigationApplication;
8
 import com.reactnativenavigation.params.ScreenParams;
9
 import com.reactnativenavigation.params.ScreenParams;
9
 import com.reactnativenavigation.params.SideMenuParams;
10
 import com.reactnativenavigation.params.SideMenuParams;
10
 import com.reactnativenavigation.params.SnackbarParams;
11
 import com.reactnativenavigation.params.SnackbarParams;
194
     public void onSideMenuButtonClick() {
195
     public void onSideMenuButtonClick() {
195
         if (sideMenu != null) {
196
         if (sideMenu != null) {
196
             sideMenu.openDrawer();
197
             sideMenu.openDrawer();
198
+        } else {
199
+            final String navigatorEventId = stack.peek().getNavigatorEventId();
200
+            NavigationApplication.instance.sendNavigatorEvent("sideMenu", navigatorEventId);
197
         }
201
         }
198
     }
202
     }
199
 }
203
 }