|
@@ -2,9 +2,35 @@ package com.reactnativenavigation.layout;
|
2
|
2
|
|
3
|
3
|
import android.content.Context;
|
4
|
4
|
import android.support.v4.widget.DrawerLayout;
|
|
5
|
+import android.view.View;
|
|
6
|
+
|
|
7
|
+public class SideMenuLayout extends DrawerLayout implements StackLayout {
|
|
8
|
+ private StackLayout stackLayout;
|
5
|
9
|
|
6
|
|
-public class SideMenuLayout extends DrawerLayout {
|
7
|
10
|
public SideMenuLayout(Context context) {
|
8
|
11
|
super(context);
|
9
|
12
|
}
|
|
13
|
+
|
|
14
|
+ @Override
|
|
15
|
+ public void addView(View child) {
|
|
16
|
+ super.addView(child);
|
|
17
|
+ if (child instanceof StackLayout) {
|
|
18
|
+ stackLayout = (StackLayout) child;
|
|
19
|
+ }
|
|
20
|
+ }
|
|
21
|
+
|
|
22
|
+ @Override
|
|
23
|
+ public void push(View view) {
|
|
24
|
+ stackLayout.push(view);
|
|
25
|
+ }
|
|
26
|
+
|
|
27
|
+ @Override
|
|
28
|
+ public void pop() {
|
|
29
|
+ stackLayout.pop();
|
|
30
|
+ }
|
|
31
|
+
|
|
32
|
+ @Override
|
|
33
|
+ public View asView() {
|
|
34
|
+ return this;
|
|
35
|
+ }
|
10
|
36
|
}
|