react-native-navigation 7.22.0 → 7.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/ElementTransitionOptions.kt +0 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/HardwareBackButtonOptions.kt +2 -5
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/LayoutFactory.java +120 -120
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/ValueAnimationOptions.kt +3 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/interpolators/SpringInterpolator.kt +16 -16
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/parsers/TypefaceLoader.kt +0 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/CommandListenerAdapter.java +0 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java +7 -6
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationPackage.kt +1 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +5 -5
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalLayoutController.kt +7 -7
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalViewManager.kt +25 -9
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/CoordinatorLayoutUtils.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/OutlineProvider.kt +0 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReflectionUtils.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/RenderChecker.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/StatusBarUtils.java +0 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/UiUtils.java +5 -6
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/ViewParent.kt +0 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/ViewUtils.java +4 -5
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabPresenter.java +6 -8
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsAnimator.kt +0 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java +3 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/attacher/BottomTabsAttacher.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/attacher/modes/AttachMode.java +3 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/attacher/modes/OnSwitchToTab.java +2 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/child/ChildController.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/child/ChildControllersRegistry.java +5 -5
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentPresenterBase.java +0 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewController.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalPresenter.java +6 -6
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalStack.java +18 -18
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/navigator/Navigator.java +12 -12
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/parent/ParentController.java +22 -22
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuController.java +16 -16
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuPresenter.java +4 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/FabPresenter.java +8 -8
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/IdStack.java +14 -14
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java +29 -29
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerBuilder.java +3 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenter.java +29 -28
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/TopBarAnimator.kt +1 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/TopBarBackgroundViewController.java +0 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/TopBarController.kt +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/BackButtonHelper.java +2 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonPresenter.kt +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonSpan.kt +0 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/IconResolver.java +0 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabsAdapter.java +5 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabsController.java +8 -8
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsContainer.kt +1 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsLayout.java +0 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/PropertyAnimatorCreator.kt +2 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/ReactImageBoundsAnimator.kt +0 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/ReactImageMatrixAnimator.kt +2 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/ReactViewRotationAnimator.kt +0 -5
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +1 -22
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/toptabs/TopTabsLayoutCreator.java +2 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/toptabs/TopTabsViewPager.java +6 -6
- package/lib/android/app/src/reactNative63/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +0 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/BaseTest.java +23 -28
- package/lib/android/app/src/test/java/com/reactnativenavigation/TestUtils.java +4 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestComponentLayout.java +3 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/options/parsers/ColorParseTest.java +0 -3
- package/lib/android/app/src/test/java/com/reactnativenavigation/presentation/RenderCheckerTest.java +6 -6
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabPresenterTest.java +3 -4
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsAttacherTest.java +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsControllerTest.java +13 -15
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/attacher/modes/AttachModeTest.java +5 -5
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/child/ChildControllerTest.java +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/child/ChildControllersRegistryTest.java +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalPresenterTest.java +4 -4
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalStackTest.java +10 -10
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java +25 -26
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/RootPresenterTest.kt +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/parent/ParentControllerTest.java +15 -15
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuControllerTest.java +11 -11
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/BackButtonHelperTest.java +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackAnimatorTest.kt +0 -4
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerTest.kt +15 -15
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenterTest.kt +17 -17
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/TopBarControllerTest.kt +3 -3
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabsViewControllerTest.java +9 -9
- package/lib/dist/components/Modal.js +1 -2
- package/lib/src/components/Modal.tsx +1 -2
- package/package.json +1 -1
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
package com.reactnativenavigation;
|
|
2
2
|
|
|
3
|
+
import static com.reactnativenavigation.utils.CollectionUtils.forEach;
|
|
4
|
+
import static org.assertj.core.api.Java6Assertions.assertThat;
|
|
5
|
+
import static org.mockito.ArgumentMatchers.any;
|
|
6
|
+
import static org.mockito.Mockito.mock;
|
|
7
|
+
import static org.mockito.Mockito.when;
|
|
8
|
+
|
|
3
9
|
import android.app.Activity;
|
|
4
10
|
import android.content.Context;
|
|
5
|
-
import android.content.res.AssetManager;
|
|
6
11
|
import android.content.res.Configuration;
|
|
7
12
|
import android.content.res.Resources;
|
|
8
|
-
import android.graphics.Color;
|
|
9
13
|
import android.os.Handler;
|
|
10
14
|
import android.os.Looper;
|
|
11
|
-
import android.util.DisplayMetrics;
|
|
12
15
|
import android.view.View;
|
|
13
16
|
import android.view.ViewGroup;
|
|
14
17
|
|
|
18
|
+
import androidx.annotation.CallSuper;
|
|
19
|
+
import androidx.appcompat.app.AppCompatActivity;
|
|
20
|
+
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
|
21
|
+
|
|
15
22
|
import com.reactnativenavigation.options.params.Bool;
|
|
16
23
|
import com.reactnativenavigation.utils.Functions;
|
|
17
24
|
import com.reactnativenavigation.utils.StatusBarUtils;
|
|
@@ -33,18 +40,6 @@ import org.robolectric.shadows.ShadowLooper;
|
|
|
33
40
|
|
|
34
41
|
import java.util.Arrays;
|
|
35
42
|
|
|
36
|
-
import androidx.annotation.CallSuper;
|
|
37
|
-
import androidx.appcompat.app.AppCompatActivity;
|
|
38
|
-
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
|
39
|
-
|
|
40
|
-
import static com.reactnativenavigation.utils.CollectionUtils.*;
|
|
41
|
-
import static org.assertj.core.api.Java6Assertions.assertThat;
|
|
42
|
-
import static org.mockito.ArgumentMatchers.any;
|
|
43
|
-
import static org.mockito.Mockito.mock;
|
|
44
|
-
import static org.mockito.Mockito.when;
|
|
45
|
-
|
|
46
|
-
import kotlin.Function;
|
|
47
|
-
|
|
48
43
|
@RunWith(RobolectricTestRunner.class)
|
|
49
44
|
@Config(sdk = 28, application = TestApplication.class)
|
|
50
45
|
public abstract class BaseTest {
|
|
@@ -90,7 +85,7 @@ public abstract class BaseTest {
|
|
|
90
85
|
return Robolectric.buildActivity(clazz);
|
|
91
86
|
}
|
|
92
87
|
|
|
93
|
-
public void assertIsChild(ViewGroup parent, ViewController
|
|
88
|
+
public void assertIsChild(ViewGroup parent, ViewController<?>... children) {
|
|
94
89
|
forEach(Arrays.asList(children), c -> assertIsChild(parent, c.getView()));
|
|
95
90
|
}
|
|
96
91
|
|
|
@@ -100,7 +95,7 @@ public abstract class BaseTest {
|
|
|
100
95
|
assertThat(ViewUtils.isChildOf(parent, child)).isTrue();
|
|
101
96
|
}
|
|
102
97
|
|
|
103
|
-
public void assertNotChildOf(ViewGroup parent, ViewController
|
|
98
|
+
public void assertNotChildOf(ViewGroup parent, ViewController<?>... children) {
|
|
104
99
|
forEach(Arrays.asList(children), c -> assertNotChildOf(parent, c.getView()));
|
|
105
100
|
}
|
|
106
101
|
|
|
@@ -115,31 +110,31 @@ public abstract class BaseTest {
|
|
|
115
110
|
assertThat(view.getLayoutParams().height).isEqualTo(ViewGroup.LayoutParams.MATCH_PARENT);
|
|
116
111
|
}
|
|
117
112
|
|
|
118
|
-
protected void disablePushAnimation(ViewController
|
|
119
|
-
for (ViewController controller : controllers) {
|
|
113
|
+
protected void disablePushAnimation(ViewController<?>... controllers) {
|
|
114
|
+
for (ViewController<?> controller : controllers) {
|
|
120
115
|
controller.options.animations.push.enabled = new Bool(false);
|
|
121
116
|
}
|
|
122
117
|
}
|
|
123
118
|
|
|
124
|
-
protected void disablePopAnimation(ViewController
|
|
125
|
-
for (ViewController controller : controllers) {
|
|
119
|
+
protected void disablePopAnimation(ViewController<?>... controllers) {
|
|
120
|
+
for (ViewController<?> controller : controllers) {
|
|
126
121
|
controller.options.animations.pop.enabled = new Bool(false);
|
|
127
122
|
}
|
|
128
123
|
}
|
|
129
124
|
|
|
130
|
-
protected void disableModalAnimations(ViewController
|
|
125
|
+
protected void disableModalAnimations(ViewController<?>... modals) {
|
|
131
126
|
disableShowModalAnimation(modals);
|
|
132
127
|
disableDismissModalAnimation(modals);
|
|
133
128
|
}
|
|
134
129
|
|
|
135
|
-
protected void disableShowModalAnimation(ViewController
|
|
136
|
-
for (ViewController modal : modals) {
|
|
130
|
+
protected void disableShowModalAnimation(ViewController<?>... modals) {
|
|
131
|
+
for (ViewController<?> modal : modals) {
|
|
137
132
|
modal.options.animations.showModal.toggle(new Bool(false));
|
|
138
133
|
}
|
|
139
134
|
}
|
|
140
135
|
|
|
141
|
-
protected void disableDismissModalAnimation(ViewController
|
|
142
|
-
for (ViewController modal : modals) {
|
|
136
|
+
protected void disableDismissModalAnimation(ViewController<?>... modals) {
|
|
137
|
+
for (ViewController<?> modal : modals) {
|
|
143
138
|
modal.options.animations.dismissModal.toggle(new Bool(false));
|
|
144
139
|
}
|
|
145
140
|
}
|
|
@@ -152,8 +147,8 @@ public abstract class BaseTest {
|
|
|
152
147
|
view.getViewTreeObserver().dispatchOnGlobalLayout();
|
|
153
148
|
}
|
|
154
149
|
|
|
155
|
-
protected void addToParent(Context context, ViewController
|
|
156
|
-
for (ViewController controller : controllers) {
|
|
150
|
+
protected void addToParent(Context context, ViewController<?>... controllers) {
|
|
151
|
+
for (ViewController<?> controller : controllers) {
|
|
157
152
|
new CoordinatorLayout(context).addView(controller.getView());
|
|
158
153
|
}
|
|
159
154
|
}
|
|
@@ -5,6 +5,8 @@ import android.content.Context;
|
|
|
5
5
|
import android.view.View;
|
|
6
6
|
import android.view.ViewGroup;
|
|
7
7
|
|
|
8
|
+
import androidx.annotation.NonNull;
|
|
9
|
+
|
|
8
10
|
import com.reactnativenavigation.mocks.TitleBarReactViewCreatorMock;
|
|
9
11
|
import com.reactnativenavigation.mocks.TopBarBackgroundViewCreatorMock;
|
|
10
12
|
import com.reactnativenavigation.mocks.TitleBarButtonCreatorMock;
|
|
@@ -31,7 +33,7 @@ public class TestUtils {
|
|
|
31
33
|
public static StackControllerBuilder newStackController(Activity activity) {
|
|
32
34
|
TopBarController topBarController = new TopBarController() {
|
|
33
35
|
@Override
|
|
34
|
-
protected TopBar createTopBar(Context context, StackLayout stackLayout) {
|
|
36
|
+
protected TopBar createTopBar(@NonNull Context context, @NonNull StackLayout stackLayout) {
|
|
35
37
|
TopBar topBar = super.createTopBar(context, stackLayout);
|
|
36
38
|
topBar.layout(0, 0, 1000, UiUtils.getTopBarHeight(context));
|
|
37
39
|
return topBar;
|
|
@@ -45,7 +47,7 @@ public class TestUtils {
|
|
|
45
47
|
.setInitialOptions(new Options());
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
public static void hideBackButton(ViewController viewController) {
|
|
50
|
+
public static void hideBackButton(ViewController<?> viewController) {
|
|
49
51
|
viewController.options.topBar.buttons.back.visible = new Bool(false);
|
|
50
52
|
}
|
|
51
53
|
|
package/lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestComponentLayout.java
CHANGED
|
@@ -4,6 +4,8 @@ import android.content.Context;
|
|
|
4
4
|
import android.view.MotionEvent;
|
|
5
5
|
import android.view.ViewGroup;
|
|
6
6
|
|
|
7
|
+
import androidx.annotation.NonNull;
|
|
8
|
+
|
|
7
9
|
import com.reactnativenavigation.options.ButtonOptions;
|
|
8
10
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ScrollEventListener;
|
|
9
11
|
import com.reactnativenavigation.options.Options;
|
|
@@ -71,7 +73,7 @@ public class TestComponentLayout extends ComponentLayout implements ButtonContro
|
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
@Override
|
|
74
|
-
public void onPress(ButtonOptions button) {
|
|
76
|
+
public void onPress(@NonNull ButtonOptions button) {
|
|
75
77
|
|
|
76
78
|
}
|
|
77
79
|
}
|
package/lib/android/app/src/test/java/com/reactnativenavigation/options/parsers/ColorParseTest.java
CHANGED
|
@@ -6,7 +6,6 @@ import com.facebook.react.bridge.JavaOnlyMap;
|
|
|
6
6
|
import com.reactnativenavigation.BaseTest;
|
|
7
7
|
import com.reactnativenavigation.options.params.DontApplyColour;
|
|
8
8
|
import com.reactnativenavigation.options.params.ReactPlatformColor;
|
|
9
|
-
import com.reactnativenavigation.utils.StatusBarUtils;
|
|
10
9
|
|
|
11
10
|
import org.json.JSONArray;
|
|
12
11
|
import org.json.JSONException;
|
|
@@ -16,7 +15,6 @@ import org.mockito.MockedStatic;
|
|
|
16
15
|
import org.mockito.Mockito;
|
|
17
16
|
|
|
18
17
|
import static org.assertj.core.api.Java6Assertions.assertThat;
|
|
19
|
-
import static org.mockito.ArgumentMatchers.any;
|
|
20
18
|
|
|
21
19
|
import android.app.Activity;
|
|
22
20
|
|
|
@@ -38,7 +36,6 @@ public class ColorParseTest extends BaseTest {
|
|
|
38
36
|
|
|
39
37
|
@Test
|
|
40
38
|
public void shouldParsePlatformColors() throws JSONException {
|
|
41
|
-
JSONObject json = new JSONObject();
|
|
42
39
|
JSONObject color = new JSONObject();
|
|
43
40
|
final JSONArray jsonArray = new JSONArray();
|
|
44
41
|
jsonArray.put("@color/colorPrimary");
|
package/lib/android/app/src/test/java/com/reactnativenavigation/presentation/RenderCheckerTest.java
CHANGED
|
@@ -25,7 +25,7 @@ public class RenderCheckerTest extends BaseTest {
|
|
|
25
25
|
|
|
26
26
|
@Test
|
|
27
27
|
public void areRendered() {
|
|
28
|
-
Collection<ViewController
|
|
28
|
+
Collection<ViewController<?>> items = Arrays.asList(
|
|
29
29
|
renderedComponent(),
|
|
30
30
|
renderedComponent(),
|
|
31
31
|
renderedComponent()
|
|
@@ -36,7 +36,7 @@ public class RenderCheckerTest extends BaseTest {
|
|
|
36
36
|
|
|
37
37
|
@Test
|
|
38
38
|
public void areRendered_reduce() {
|
|
39
|
-
Collection<ViewController
|
|
39
|
+
Collection<ViewController<?>> items = Arrays.asList(
|
|
40
40
|
renderedComponent(),
|
|
41
41
|
notRenderedComponent(),
|
|
42
42
|
renderedComponent()
|
|
@@ -45,14 +45,14 @@ public class RenderCheckerTest extends BaseTest {
|
|
|
45
45
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
private ViewController renderedComponent() {
|
|
49
|
-
ViewController mock = Mockito.mock(ViewController.class);
|
|
48
|
+
private ViewController<?> renderedComponent() {
|
|
49
|
+
ViewController<?> mock = Mockito.mock(ViewController.class);
|
|
50
50
|
when(mock.isRendered()).then(__ -> true);
|
|
51
51
|
return mock;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
private ViewController notRenderedComponent() {
|
|
55
|
-
ViewController mock = Mockito.mock(ViewController.class);
|
|
54
|
+
private ViewController<?> notRenderedComponent() {
|
|
55
|
+
ViewController<?> mock = Mockito.mock(ViewController.class);
|
|
56
56
|
when(mock.isRendered()).then(__ -> false);
|
|
57
57
|
return mock;
|
|
58
58
|
}
|
|
@@ -12,7 +12,6 @@ import com.reactnativenavigation.mocks.TypefaceLoaderMock;
|
|
|
12
12
|
import com.reactnativenavigation.options.Options;
|
|
13
13
|
import com.reactnativenavigation.options.params.Colour;
|
|
14
14
|
import com.reactnativenavigation.options.params.DontApplyColour;
|
|
15
|
-
import com.reactnativenavigation.options.params.NullColor;
|
|
16
15
|
import com.reactnativenavigation.options.params.NullText;
|
|
17
16
|
import com.reactnativenavigation.options.params.NullThemeColour;
|
|
18
17
|
import com.reactnativenavigation.options.params.ThemeColour;
|
|
@@ -47,9 +46,9 @@ public class BottomTabPresenterTest extends BaseTest {
|
|
|
47
46
|
private BottomTabPresenter uut;
|
|
48
47
|
private BottomTabs bottomTabs;
|
|
49
48
|
private List<ViewController<?>> tabs;
|
|
50
|
-
private ViewController child1;
|
|
51
|
-
private ViewController child2;
|
|
52
|
-
private ViewController child3;
|
|
49
|
+
private ViewController<?> child1;
|
|
50
|
+
private ViewController<?> child2;
|
|
51
|
+
private ViewController<?> child3;
|
|
53
52
|
private Activity activity;
|
|
54
53
|
private ChildControllersRegistry childRegistry;
|
|
55
54
|
|
|
@@ -49,7 +49,7 @@ public class BottomTabsAttacherTest extends BaseTest {
|
|
|
49
49
|
|
|
50
50
|
@Test
|
|
51
51
|
public void onTabSelected() {
|
|
52
|
-
ViewController tab = mock(ViewController.class);
|
|
52
|
+
ViewController<?> tab = mock(ViewController.class);
|
|
53
53
|
uut.onTabSelected(tab);
|
|
54
54
|
verify(mode).onTabSelected(tab);
|
|
55
55
|
}
|
|
@@ -36,7 +36,6 @@ import com.reactnativenavigation.views.bottomtabs.BottomTabs;
|
|
|
36
36
|
import com.reactnativenavigation.views.bottomtabs.BottomTabsContainer;
|
|
37
37
|
import com.reactnativenavigation.views.bottomtabs.BottomTabsLayout;
|
|
38
38
|
|
|
39
|
-
import org.jetbrains.annotations.NotNull;
|
|
40
39
|
import org.junit.Test;
|
|
41
40
|
import org.mockito.ArgumentCaptor;
|
|
42
41
|
import org.mockito.Mockito;
|
|
@@ -50,7 +49,6 @@ import androidx.annotation.NonNull;
|
|
|
50
49
|
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
|
51
50
|
|
|
52
51
|
|
|
53
|
-
import static com.nhaarman.mockitokotlin2.OngoingStubbingKt.whenever;
|
|
54
52
|
import static com.reactnativenavigation.TestUtils.hideBackButton;
|
|
55
53
|
import static com.reactnativenavigation.utils.ObjectUtils.perform;
|
|
56
54
|
import static org.assertj.core.api.Java6Assertions.assertThat;
|
|
@@ -68,12 +66,12 @@ public class BottomTabsControllerTest extends BaseTest {
|
|
|
68
66
|
private BottomTabsContainer bottomTabsContainer;
|
|
69
67
|
private BottomTabsController uut;
|
|
70
68
|
private final Options initialOptions = new Options();
|
|
71
|
-
private ViewController child1;
|
|
72
|
-
private ViewController child2;
|
|
73
|
-
private ViewController child3;
|
|
74
|
-
private ViewController stackChild;
|
|
69
|
+
private ViewController<?> child1;
|
|
70
|
+
private ViewController<?> child2;
|
|
71
|
+
private ViewController<?> child3;
|
|
72
|
+
private ViewController<?> stackChild;
|
|
75
73
|
private StackController child4;
|
|
76
|
-
private ViewController child5;
|
|
74
|
+
private ViewController<?> child5;
|
|
77
75
|
private final Options tabOptions = OptionHelper.createBottomTabOptions();
|
|
78
76
|
private final ImageLoader imageLoaderMock = ImageLoaderMock.mock();
|
|
79
77
|
private EventEmitter eventEmitter;
|
|
@@ -125,7 +123,7 @@ public class BottomTabsControllerTest extends BaseTest {
|
|
|
125
123
|
@Test
|
|
126
124
|
public void parentControllerIsSet() {
|
|
127
125
|
uut = createBottomTabs();
|
|
128
|
-
for (ViewController tab : tabs) {
|
|
126
|
+
for (ViewController<?> tab : tabs) {
|
|
129
127
|
assertThat(tab.getParentController()).isEqualTo(uut);
|
|
130
128
|
}
|
|
131
129
|
}
|
|
@@ -134,7 +132,7 @@ public class BottomTabsControllerTest extends BaseTest {
|
|
|
134
132
|
public void setTabs_allChildViewsAreAttachedToHierarchy() {
|
|
135
133
|
uut.onViewWillAppear();
|
|
136
134
|
assertThat(uut.getView().getChildCount()).isEqualTo(6);
|
|
137
|
-
for (ViewController child : uut.getChildControllers()) {
|
|
135
|
+
for (ViewController<?> child : uut.getChildControllers()) {
|
|
138
136
|
assertThat(child.getView().getParent()).isNotNull();
|
|
139
137
|
}
|
|
140
138
|
}
|
|
@@ -152,13 +150,13 @@ public class BottomTabsControllerTest extends BaseTest {
|
|
|
152
150
|
public void onTabSelected() {
|
|
153
151
|
uut.ensureViewIsCreated();
|
|
154
152
|
assertThat(uut.getSelectedIndex()).isZero();
|
|
155
|
-
assertThat(((ViewController) ((List) uut.getChildControllers()).get(0)).getView().getVisibility()).isEqualTo(View.VISIBLE);
|
|
153
|
+
assertThat(((ViewController<?>) ((List<?>) uut.getChildControllers()).get(0)).getView().getVisibility()).isEqualTo(View.VISIBLE);
|
|
156
154
|
|
|
157
155
|
uut.onTabSelected(3, false);
|
|
158
156
|
|
|
159
157
|
assertThat(uut.getSelectedIndex()).isEqualTo(3);
|
|
160
|
-
assertThat(((ViewController) ((List) uut.getChildControllers()).get(0)).getView().getVisibility()).isEqualTo(View.INVISIBLE);
|
|
161
|
-
assertThat(((ViewController) ((List) uut.getChildControllers()).get(3)).getView().getVisibility()).isEqualTo(View.VISIBLE);
|
|
158
|
+
assertThat(((ViewController<?>) ((List<?>) uut.getChildControllers()).get(0)).getView().getVisibility()).isEqualTo(View.INVISIBLE);
|
|
159
|
+
assertThat(((ViewController<?>) ((List<?>) uut.getChildControllers()).get(3)).getView().getVisibility()).isEqualTo(View.VISIBLE);
|
|
162
160
|
verify(eventEmitter).emitBottomTabSelected(0, 3);
|
|
163
161
|
}
|
|
164
162
|
|
|
@@ -170,7 +168,7 @@ public class BottomTabsControllerTest extends BaseTest {
|
|
|
170
168
|
uut.onTabSelected(0, true);
|
|
171
169
|
|
|
172
170
|
assertThat(uut.getSelectedIndex()).isEqualTo(0);
|
|
173
|
-
assertThat(((ViewController) ((List) uut.getChildControllers()).get(0)).getView().getParent()).isNotNull();
|
|
171
|
+
assertThat(((ViewController<?>) ((List<?>) uut.getChildControllers()).get(0)).getView().getParent()).isNotNull();
|
|
174
172
|
verify(eventEmitter).emitBottomTabSelected(0, 0);
|
|
175
173
|
}
|
|
176
174
|
|
|
@@ -185,7 +183,7 @@ public class BottomTabsControllerTest extends BaseTest {
|
|
|
185
183
|
|
|
186
184
|
@Test
|
|
187
185
|
public void applyChildOptions_bottomTabsOptionsAreClearedAfterApply() {
|
|
188
|
-
ParentController parent = Mockito.mock(ParentController.class);
|
|
186
|
+
ParentController<?> parent = Mockito.mock(ParentController.class);
|
|
189
187
|
uut.setParentController(parent);
|
|
190
188
|
|
|
191
189
|
child1.options.bottomTabsOptions.backgroundColor = new ThemeColour(new Colour(Color.RED));
|
|
@@ -456,7 +454,7 @@ public class BottomTabsControllerTest extends BaseTest {
|
|
|
456
454
|
when(child5.handleBack(any())).thenReturn(true);
|
|
457
455
|
}
|
|
458
456
|
|
|
459
|
-
private StackController spyOnStack(ViewController initialChild) {
|
|
457
|
+
private StackController spyOnStack(ViewController<?> initialChild) {
|
|
460
458
|
StackController build = TestUtils.newStackController(activity)
|
|
461
459
|
.setInitialOptions(tabOptions)
|
|
462
460
|
.build();
|
|
@@ -31,8 +31,8 @@ public abstract class AttachModeTest extends BaseTest {
|
|
|
31
31
|
private Activity activity;
|
|
32
32
|
private ChildControllersRegistry childRegistry;
|
|
33
33
|
protected ViewGroup parent;
|
|
34
|
-
ViewController tab1;
|
|
35
|
-
ViewController tab2;
|
|
34
|
+
ViewController<?> tab1;
|
|
35
|
+
ViewController<?> tab2;
|
|
36
36
|
List<ViewController<?>> tabs;
|
|
37
37
|
protected Options options;
|
|
38
38
|
protected BottomTabsPresenter presenter;
|
|
@@ -69,18 +69,18 @@ public abstract class AttachModeTest extends BaseTest {
|
|
|
69
69
|
forEach(otherTabs(), t -> assertThat(t.getView().getVisibility()).isEqualTo(View.INVISIBLE));
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
ViewController[] otherTabs() {
|
|
72
|
+
ViewController<?>[] otherTabs() {
|
|
73
73
|
return filter(tabs, t -> t != initialTab()).toArray(new ViewController[0]);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
ViewController initialTab() {
|
|
76
|
+
ViewController<?> initialTab() {
|
|
77
77
|
return tabs.get(INITIAL_TAB);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
private List<ViewController<?>> createTabs() {
|
|
81
81
|
tab1 = new SimpleViewController(activity, childRegistry, "child1", new Options());
|
|
82
82
|
tab2 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));
|
|
83
|
-
ViewController tab3 = new SimpleViewController(activity, childRegistry, "child3", new Options());
|
|
83
|
+
ViewController<?> tab3 = new SimpleViewController(activity, childRegistry, "child3", new Options());
|
|
84
84
|
return Arrays.asList(tab1, tab2, tab3);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -16,7 +16,7 @@ import static org.mockito.Mockito.verify;
|
|
|
16
16
|
|
|
17
17
|
public class ChildControllerTest extends BaseTest {
|
|
18
18
|
|
|
19
|
-
private ChildController uut;
|
|
19
|
+
private ChildController<?> uut;
|
|
20
20
|
private ChildControllersRegistry childRegistry;
|
|
21
21
|
private Presenter presenter;
|
|
22
22
|
private Options resolvedOptions = new Options();
|
|
@@ -31,7 +31,7 @@ public class ChildControllerTest extends BaseTest {
|
|
|
31
31
|
return resolvedOptions;
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
ParentController parent = Mockito.mock(ParentController.class);
|
|
34
|
+
ParentController<?> parent = Mockito.mock(ParentController.class);
|
|
35
35
|
uut.setParentController(parent);
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -15,8 +15,8 @@ import static org.mockito.Mockito.verify;
|
|
|
15
15
|
|
|
16
16
|
public class ChildControllersRegistryTest extends BaseTest {
|
|
17
17
|
private ChildControllersRegistry uut;
|
|
18
|
-
private ChildController child1;
|
|
19
|
-
private ChildController child2;
|
|
18
|
+
private ChildController<?> child1;
|
|
19
|
+
private ChildController<?> child2;
|
|
20
20
|
|
|
21
21
|
@Override
|
|
22
22
|
public void beforeEach() {
|
|
@@ -40,11 +40,11 @@ public class ModalPresenterTest extends BaseTest {
|
|
|
40
40
|
private static final String MODAL_ID_1 = "modalId1";
|
|
41
41
|
private static final String MODAL_ID_2 = "modalId2";
|
|
42
42
|
|
|
43
|
-
private ChildController modal1;
|
|
44
|
-
private ChildController modal2;
|
|
43
|
+
private ChildController<?> modal1;
|
|
44
|
+
private ChildController<?> modal2;
|
|
45
45
|
private ModalPresenter uut;
|
|
46
46
|
private ModalAnimator animator;
|
|
47
|
-
private ViewController root;
|
|
47
|
+
private ViewController<?> root;
|
|
48
48
|
private CoordinatorLayout modalsLayout;
|
|
49
49
|
|
|
50
50
|
|
|
@@ -285,7 +285,7 @@ public class ModalPresenterTest extends BaseTest {
|
|
|
285
285
|
public void dismissModal_successIsReportedBeforeViewIsDestroyed() {
|
|
286
286
|
disableModalAnimations(modal1);
|
|
287
287
|
CommandListenerAdapter listener = Mockito.mock(CommandListenerAdapter.class);
|
|
288
|
-
ViewController modal = spy(modal1);
|
|
288
|
+
ViewController<?> modal = spy(modal1);
|
|
289
289
|
InOrder inOrder = inOrder(listener, modal);
|
|
290
290
|
|
|
291
291
|
uut.showModal(modal, root, new CommandListenerAdapter());
|
|
@@ -40,16 +40,16 @@ public class ModalStackTest extends BaseTest {
|
|
|
40
40
|
private static final String MODAL_ID_4 = "modalId4";
|
|
41
41
|
|
|
42
42
|
private ModalStack uut;
|
|
43
|
-
private ViewController modal1;
|
|
44
|
-
private ViewController modal2;
|
|
45
|
-
private ViewController modal3;
|
|
46
|
-
private ViewController modal4;
|
|
43
|
+
private ViewController<?> modal1;
|
|
44
|
+
private ViewController<?> modal2;
|
|
45
|
+
private ViewController<?> modal3;
|
|
46
|
+
private ViewController<?> modal4;
|
|
47
47
|
private StackController stack;
|
|
48
48
|
private Activity activity;
|
|
49
49
|
private ChildControllersRegistry childRegistry;
|
|
50
50
|
private ModalPresenter presenter;
|
|
51
51
|
private ModalAnimator animator;
|
|
52
|
-
private ViewController root;
|
|
52
|
+
private ViewController<?> root;
|
|
53
53
|
private EventEmitter emitter;
|
|
54
54
|
|
|
55
55
|
@Override
|
|
@@ -308,7 +308,7 @@ public class ModalStackTest extends BaseTest {
|
|
|
308
308
|
|
|
309
309
|
@Test
|
|
310
310
|
public void handleBack_ViewControllerTakesPrecedenceOverModal() {
|
|
311
|
-
ViewController backHandlingModal = spy(new SimpleViewController(activity, childRegistry, "stack", new Options()){
|
|
311
|
+
ViewController<?> backHandlingModal = spy(new SimpleViewController(activity, childRegistry, "stack", new Options()){
|
|
312
312
|
@Override
|
|
313
313
|
public boolean handleBack(CommandListener listener) {
|
|
314
314
|
return true;
|
|
@@ -338,17 +338,17 @@ public class ModalStackTest extends BaseTest {
|
|
|
338
338
|
verify(modal2).destroy();
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
private ViewController findModal(String id) {
|
|
341
|
+
private ViewController<?> findModal(String id) {
|
|
342
342
|
return uut.findControllerById(id);
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
-
private void showModalsWithoutAnimation(ViewController
|
|
346
|
-
for (ViewController modal : modals) {
|
|
345
|
+
private void showModalsWithoutAnimation(ViewController<?>... modals) {
|
|
346
|
+
for (ViewController<?> modal : modals) {
|
|
347
347
|
showModalWithoutAnimation(modal);
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
private void showModalWithoutAnimation(ViewController modal) {
|
|
351
|
+
private void showModalWithoutAnimation(ViewController<?> modal) {
|
|
352
352
|
disableShowModalAnimation(modal);
|
|
353
353
|
uut.showModal(modal, root, new CommandListenerAdapter());
|
|
354
354
|
}
|
|
@@ -36,7 +36,6 @@ import com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry;
|
|
|
36
36
|
import com.reactnativenavigation.viewcontrollers.component.ComponentViewController;
|
|
37
37
|
import com.reactnativenavigation.viewcontrollers.modal.ModalStack;
|
|
38
38
|
import com.reactnativenavigation.viewcontrollers.overlay.OverlayManager;
|
|
39
|
-
import com.reactnativenavigation.viewcontrollers.parent.ParentController;
|
|
40
39
|
import com.reactnativenavigation.viewcontrollers.stack.StackController;
|
|
41
40
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter;
|
|
42
41
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.RootPresenter;
|
|
@@ -71,10 +70,10 @@ public class NavigatorTest extends BaseTest {
|
|
|
71
70
|
private RootPresenter rootPresenter;
|
|
72
71
|
private StackController parentController;
|
|
73
72
|
private SimpleViewController child1;
|
|
74
|
-
private ViewController child2;
|
|
75
|
-
private ViewController child3;
|
|
76
|
-
private ViewController child4;
|
|
77
|
-
private ViewController child5;
|
|
73
|
+
private ViewController<?> child2;
|
|
74
|
+
private ViewController<?> child3;
|
|
75
|
+
private ViewController<?> child4;
|
|
76
|
+
private ViewController<?> child5;
|
|
78
77
|
private final Options tabOptions = OptionHelper.createBottomTabOptions();
|
|
79
78
|
private ImageLoader imageLoaderMock;
|
|
80
79
|
private ActivityController<TestActivity> activityController;
|
|
@@ -100,7 +99,7 @@ public class NavigatorTest extends BaseTest {
|
|
|
100
99
|
uut = new Navigator(activity, childRegistry, modalStack, overlayManager, rootPresenter);
|
|
101
100
|
activity.setNavigator(uut);
|
|
102
101
|
|
|
103
|
-
ViewController initialChild = new SimpleViewController(activity, childRegistry, "initialChild", Options.EMPTY);
|
|
102
|
+
ViewController<?> initialChild = new SimpleViewController(activity, childRegistry, "initialChild", Options.EMPTY);
|
|
104
103
|
parentController = newStack(initialChild);
|
|
105
104
|
parentVisibilityListener = spy(new ViewController.ViewVisibilityListener() {
|
|
106
105
|
@Override
|
|
@@ -131,8 +130,8 @@ public class NavigatorTest extends BaseTest {
|
|
|
131
130
|
public void onConfigurationChange_shouldCallOnConfigurationChangedForModals() {
|
|
132
131
|
Navigator spyUUT = spy(uut);
|
|
133
132
|
SimpleViewController spyChild1 = spy(child1);
|
|
134
|
-
ViewController spyChild2 = spy(child2);
|
|
135
|
-
ViewController spyChild3 = spy(child3);
|
|
133
|
+
ViewController<?> spyChild2 = spy(child2);
|
|
134
|
+
ViewController<?> spyChild3 = spy(child3);
|
|
136
135
|
|
|
137
136
|
spyUUT.setRoot(spyChild1, new CommandListenerAdapter(), reactInstanceManager);
|
|
138
137
|
spyUUT.showModal(spyChild2, new CommandListenerAdapter());
|
|
@@ -147,8 +146,8 @@ public class NavigatorTest extends BaseTest {
|
|
|
147
146
|
public void onConfigurationChange_shouldCallOnConfigurationChangedForOverlays() {
|
|
148
147
|
Navigator spyUUT = spy(uut);
|
|
149
148
|
SimpleViewController spyChild1 = spy(child1);
|
|
150
|
-
ViewController spyChild2 = spy(child2);
|
|
151
|
-
ViewController spyChild3 = spy(child3);
|
|
149
|
+
ViewController<?> spyChild2 = spy(child2);
|
|
150
|
+
ViewController<?> spyChild3 = spy(child3);
|
|
152
151
|
|
|
153
152
|
spyUUT.setRoot(spyChild1, new CommandListenerAdapter(), reactInstanceManager);
|
|
154
153
|
spyUUT.showOverlay(spyChild2, new CommandListenerAdapter());
|
|
@@ -198,8 +197,8 @@ public class NavigatorTest extends BaseTest {
|
|
|
198
197
|
@Test
|
|
199
198
|
public void shouldCallOverlaysChildrenOnViewDidAppearOnHostResume() {
|
|
200
199
|
SimpleViewController child1 = spy(this.child1);
|
|
201
|
-
ViewController child2 = spy(this.child2);
|
|
202
|
-
ViewController child3 = spy(this.child3);
|
|
200
|
+
ViewController<?> child2 = spy(this.child2);
|
|
201
|
+
ViewController<?> child3 = spy(this.child3);
|
|
203
202
|
|
|
204
203
|
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
|
|
205
204
|
uut.showOverlay(child2, new CommandListenerAdapter());
|
|
@@ -220,7 +219,7 @@ public class NavigatorTest extends BaseTest {
|
|
|
220
219
|
final Options overContextOptions = tabOptions.copy();
|
|
221
220
|
overContextOptions.modal =new ModalOptions();
|
|
222
221
|
overContextOptions.modal.presentationStyle = ModalPresentationStyle.OverCurrentContext;
|
|
223
|
-
ViewController overContextModal = spy(new SimpleViewController(activity, childRegistry, "overContextModal",
|
|
222
|
+
ViewController<?> overContextModal = spy(new SimpleViewController(activity, childRegistry, "overContextModal",
|
|
224
223
|
overContextOptions));
|
|
225
224
|
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
|
|
226
225
|
uut.showModal(overContextModal, new CommandListenerAdapter());
|
|
@@ -236,7 +235,7 @@ public class NavigatorTest extends BaseTest {
|
|
|
236
235
|
final Options overContextOptions = tabOptions.copy();
|
|
237
236
|
overContextOptions.modal =new ModalOptions();
|
|
238
237
|
overContextOptions.modal.presentationStyle = ModalPresentationStyle.OverCurrentContext;
|
|
239
|
-
ViewController overContextModal = spy(new SimpleViewController(activity, childRegistry, "overContextModal",
|
|
238
|
+
ViewController<?> overContextModal = spy(new SimpleViewController(activity, childRegistry, "overContextModal",
|
|
240
239
|
overContextOptions));
|
|
241
240
|
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
|
|
242
241
|
uut.showModal(overContextModal, new CommandListenerAdapter());
|
|
@@ -249,11 +248,11 @@ public class NavigatorTest extends BaseTest {
|
|
|
249
248
|
@Test
|
|
250
249
|
public void shouldCallModalOnViewDisappearWhenModalDisplayedOverContextUnderneath(){
|
|
251
250
|
SimpleViewController child1 = spy(this.child1);
|
|
252
|
-
ViewController child2 = spy(this.child2);
|
|
251
|
+
ViewController<?> child2 = spy(this.child2);
|
|
253
252
|
final Options overContextOptions = tabOptions.copy();
|
|
254
253
|
overContextOptions.modal =new ModalOptions();
|
|
255
254
|
overContextOptions.modal.presentationStyle = ModalPresentationStyle.OverCurrentContext;
|
|
256
|
-
ViewController overContextModal = spy(new SimpleViewController(activity, childRegistry, "overContextModal",
|
|
255
|
+
ViewController<?> overContextModal = spy(new SimpleViewController(activity, childRegistry, "overContextModal",
|
|
257
256
|
overContextOptions));
|
|
258
257
|
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
|
|
259
258
|
uut.showModal(overContextModal, new CommandListenerAdapter());
|
|
@@ -266,9 +265,9 @@ public class NavigatorTest extends BaseTest {
|
|
|
266
265
|
@Test
|
|
267
266
|
public void shouldCallOverlaysAndModalsChildrenOnViewDidAppearOnHostResume() {
|
|
268
267
|
SimpleViewController child1 = spy(this.child1);
|
|
269
|
-
ViewController child2 = spy(this.child2);
|
|
270
|
-
ViewController child3 = spy(this.child3);
|
|
271
|
-
ViewController child4 = spy(this.child4);
|
|
268
|
+
ViewController<?> child2 = spy(this.child2);
|
|
269
|
+
ViewController<?> child3 = spy(this.child3);
|
|
270
|
+
ViewController<?> child4 = spy(this.child4);
|
|
272
271
|
|
|
273
272
|
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
|
|
274
273
|
uut.showModal(child2, new CommandListenerAdapter());
|
|
@@ -296,7 +295,7 @@ public class NavigatorTest extends BaseTest {
|
|
|
296
295
|
@Test
|
|
297
296
|
public void shouldCallModalPeekDidAppearWhenHostResumes() {
|
|
298
297
|
SimpleViewController child1 = spy(this.child1);
|
|
299
|
-
ViewController child2 = spy(this.child2);
|
|
298
|
+
ViewController<?> child2 = spy(this.child2);
|
|
300
299
|
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
|
|
301
300
|
uut.showModal(child2, new CommandListenerAdapter());
|
|
302
301
|
uut.onHostResume();
|
|
@@ -325,7 +324,7 @@ public class NavigatorTest extends BaseTest {
|
|
|
325
324
|
@Test
|
|
326
325
|
public void shouldCallModalPeekDidDisappearWhenHostPauses() {
|
|
327
326
|
SimpleViewController child1 = spy(this.child1);
|
|
328
|
-
ViewController child2 = spy(this.child2);
|
|
327
|
+
ViewController<?> child2 = spy(this.child2);
|
|
329
328
|
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
|
|
330
329
|
uut.showModal(child2, new CommandListenerAdapter());
|
|
331
330
|
uut.onHostPause();
|
|
@@ -383,11 +382,11 @@ public class NavigatorTest extends BaseTest {
|
|
|
383
382
|
|
|
384
383
|
@Test
|
|
385
384
|
public void setRoot_withWaitForRender() {
|
|
386
|
-
ViewController initialRoot = spy(child2);
|
|
385
|
+
ViewController<?> initialRoot = spy(child2);
|
|
387
386
|
uut.setRoot(initialRoot, new CommandListenerAdapter(), reactInstanceManager);
|
|
388
387
|
|
|
389
388
|
child3.options.animations.setRoot.getEnter().waitForRender = new Bool(true);
|
|
390
|
-
ViewController secondRoot = spy(child3);
|
|
389
|
+
ViewController<?> secondRoot = spy(child3);
|
|
391
390
|
CommandListenerAdapter listener = spy(new CommandListenerAdapter());
|
|
392
391
|
uut.setRoot(secondRoot, listener, reactInstanceManager);
|
|
393
392
|
|
|
@@ -552,7 +551,7 @@ public class NavigatorTest extends BaseTest {
|
|
|
552
551
|
public void handleBack_DelegatesToRoot() {
|
|
553
552
|
assertThat(uut.handleBack(new CommandListenerAdapter())).isFalse();
|
|
554
553
|
|
|
555
|
-
ViewController root = spy(child1);
|
|
554
|
+
ViewController<?> root = spy(child1);
|
|
556
555
|
uut.setRoot(root, new CommandListenerAdapter(), reactInstanceManager);
|
|
557
556
|
when(root.handleBack(any(CommandListener.class))).thenReturn(true);
|
|
558
557
|
assertThat(uut.handleBack(new CommandListenerAdapter())).isTrue();
|
|
@@ -561,7 +560,7 @@ public class NavigatorTest extends BaseTest {
|
|
|
561
560
|
|
|
562
561
|
@Test
|
|
563
562
|
public void handleBack_modalTakePrecedenceOverRoot() {
|
|
564
|
-
ViewController root = spy(child1);
|
|
563
|
+
ViewController<?> root = spy(child1);
|
|
565
564
|
uut.setRoot(root, new CommandListenerAdapter(), reactInstanceManager);
|
|
566
565
|
uut.showModal(child2, new CommandListenerAdapter());
|
|
567
566
|
verify(root, times(0)).handleBack(new CommandListenerAdapter());
|
|
@@ -886,7 +885,7 @@ public class NavigatorTest extends BaseTest {
|
|
|
886
885
|
}
|
|
887
886
|
|
|
888
887
|
@NonNull
|
|
889
|
-
private StackController newStack(ViewController
|
|
888
|
+
private StackController newStack(ViewController<?>... children) {
|
|
890
889
|
StackController stack = TestUtils.newStackController(activity)
|
|
891
890
|
.setChildren(children)
|
|
892
891
|
.setChildRegistry(childRegistry)
|