Browse Source

static navigationOptions

Daniel Zlotin 7 years ago
parent
commit
5346561cb8

+ 1
- 3
AndroidE2E/app/src/androidTest/java/com/reactnativenavigation/e2e/androide2e/ScreenStyleStaticTest.java View File

2
 
2
 
3
 import android.support.test.uiautomator.By;
3
 import android.support.test.uiautomator.By;
4
 
4
 
5
-import org.junit.Ignore;
6
 import org.junit.Test;
5
 import org.junit.Test;
7
 
6
 
8
 public class ScreenStyleStaticTest extends BaseTest {
7
 public class ScreenStyleStaticTest extends BaseTest {
9
 
8
 
10
 	@Test
9
 	@Test
11
-	@Ignore
12
 	public void declareNavigationStyleOnContainerComponent() throws Exception {
10
 	public void declareNavigationStyleOnContainerComponent() throws Exception {
13
 		launchTheApp();
11
 		launchTheApp();
14
 		assertMainShown();
12
 		assertMainShown();
15
-		elementByText("PUSH").click();
13
+		elementByText("PUSH OPTIONS SCREEN").click();
16
 		assertExists(By.text("Static Title"));
14
 		assertExists(By.text("Static Title"));
17
 	}
15
 	}
18
 }
16
 }

+ 1
- 0
AndroidE2E/app/src/androidTest/java/com/reactnativenavigation/e2e/androide2e/TopLevelApiTest.java View File

2
 
2
 
3
 import android.support.test.uiautomator.By;
3
 import android.support.test.uiautomator.By;
4
 
4
 
5
+import org.junit.Ignore;
5
 import org.junit.Test;
6
 import org.junit.Test;
6
 
7
 
7
 public class TopLevelApiTest extends BaseTest {
8
 public class TopLevelApiTest extends BaseTest {

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/NavigationActivity.java View File

6
 import android.view.KeyEvent;
6
 import android.view.KeyEvent;
7
 
7
 
8
 import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
8
 import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
9
-import com.reactnativenavigation.viewcontrollers.Navigator;
9
+import com.reactnativenavigation.layout.Navigator;
10
 
10
 
11
 public class NavigationActivity extends AppCompatActivity implements DefaultHardwareBackBtnHandler {
11
 public class NavigationActivity extends AppCompatActivity implements DefaultHardwareBackBtnHandler {
12
 	private Navigator navigator;
12
 	private Navigator navigator;

lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/Navigator.java → lib/android/app/src/main/java/com/reactnativenavigation/layout/Navigator.java View File

1
-package com.reactnativenavigation.viewcontrollers;
1
+package com.reactnativenavigation.layout;
2
 
2
 
3
 import android.app.Activity;
3
 import android.app.Activity;
4
 import android.support.annotation.NonNull;
4
 import android.support.annotation.NonNull;
6
 import android.widget.FrameLayout;
6
 import android.widget.FrameLayout;
7
 
7
 
8
 import com.reactnativenavigation.utils.CompatUtils;
8
 import com.reactnativenavigation.utils.CompatUtils;
9
+import com.reactnativenavigation.viewcontrollers.ParentController;
10
+import com.reactnativenavigation.viewcontrollers.StackController;
11
+import com.reactnativenavigation.viewcontrollers.ViewController;
9
 
12
 
10
 import java.util.Collection;
13
 import java.util.Collection;
11
 import java.util.Collections;
14
 import java.util.Collections;

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/layout/ReactRootViewController.java View File

18
 	private boolean attachedToReactInstance = false;
18
 	private boolean attachedToReactInstance = false;
19
 	private ReactRootView reactRootView;
19
 	private ReactRootView reactRootView;
20
 
20
 
21
-	public ReactRootViewController(final Activity activity, final String id, final String name, String title, final ReactInstanceManager reactInstanceManager) {
21
+	public ReactRootViewController(final Activity activity, final String id, final String name, final String title, final ReactInstanceManager reactInstanceManager) {
22
 		super(activity, id);
22
 		super(activity, id);
23
 		this.name = name;
23
 		this.name = name;
24
 		this.title = title;
24
 		this.title = title;

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java View File

13
 import com.reactnativenavigation.parse.JSONParser;
13
 import com.reactnativenavigation.parse.JSONParser;
14
 import com.reactnativenavigation.parse.LayoutNodeParser;
14
 import com.reactnativenavigation.parse.LayoutNodeParser;
15
 import com.reactnativenavigation.utils.UiThread;
15
 import com.reactnativenavigation.utils.UiThread;
16
-import com.reactnativenavigation.viewcontrollers.Navigator;
16
+import com.reactnativenavigation.layout.Navigator;
17
 import com.reactnativenavigation.viewcontrollers.ViewController;
17
 import com.reactnativenavigation.viewcontrollers.ViewController;
18
 
18
 
19
 public class NavigationModule extends ReactContextBaseJavaModule {
19
 public class NavigationModule extends ReactContextBaseJavaModule {

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

10
 	public TopBar(final Activity context) {
10
 	public TopBar(final Activity context) {
11
 		super(context);
11
 		super(context);
12
 		titleBar = new Toolbar(context);
12
 		titleBar = new Toolbar(context);
13
+		addView(titleBar);
13
 	}
14
 	}
14
 
15
 
15
 	public void setTitle(String title) {
16
 	public void setTitle(String title) {

+ 1
- 0
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/NavigatorTest.java View File

4
 import android.support.annotation.NonNull;
4
 import android.support.annotation.NonNull;
5
 
5
 
6
 import com.reactnativenavigation.BaseTest;
6
 import com.reactnativenavigation.BaseTest;
7
+import com.reactnativenavigation.layout.Navigator;
7
 import com.reactnativenavigation.mocks.SimpleViewController;
8
 import com.reactnativenavigation.mocks.SimpleViewController;
8
 import com.reactnativenavigation.mocks.TestStackAnimator;
9
 import com.reactnativenavigation.mocks.TestStackAnimator;
9
 import com.reactnativenavigation.utils.CompatUtils;
10
 import com.reactnativenavigation.utils.CompatUtils;