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,6 +7,7 @@ import android.view.View;
7 7
 import android.widget.RelativeLayout;
8 8
 
9 9
 import com.aurelhubert.ahbottomnavigation.AHBottomNavigation;
10
+import com.reactnativenavigation.NavigationApplication;
10 11
 import com.reactnativenavigation.params.ActivityParams;
11 12
 import com.reactnativenavigation.params.ScreenParams;
12 13
 import com.reactnativenavigation.params.SideMenuParams;
@@ -332,6 +333,9 @@ public class BottomTabsLayout extends RelativeLayout implements Layout, AHBottom
332 333
     public void onSideMenuButtonClick() {
333 334
         if (sideMenu != null) {
334 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,6 +5,7 @@ import android.support.v7.app.AppCompatActivity;
5 5
 import android.view.View;
6 6
 import android.widget.RelativeLayout;
7 7
 
8
+import com.reactnativenavigation.NavigationApplication;
8 9
 import com.reactnativenavigation.params.ScreenParams;
9 10
 import com.reactnativenavigation.params.SideMenuParams;
10 11
 import com.reactnativenavigation.params.SnackbarParams;
@@ -194,6 +195,9 @@ public class SingleScreenLayout extends RelativeLayout implements Layout {
194 195
     public void onSideMenuButtonClick() {
195 196
         if (sideMenu != null) {
196 197
             sideMenu.openDrawer();
198
+        } else {
199
+            final String navigatorEventId = stack.peek().getNavigatorEventId();
200
+            NavigationApplication.instance.sendNavigatorEvent("sideMenu", navigatorEventId);
197 201
         }
198 202
     }
199 203
 }