react-native-navigation 8.8.1 → 8.8.2-snapshot.2425
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/android/build.gradle +1 -0
- package/android/src/main/java/com/reactnativenavigation/NavigationActivity.java +48 -1
- package/android/src/main/java/com/reactnativenavigation/react/modal/ModalHostLayout.kt +2 -2
- package/android/src/main/java/com/reactnativenavigation/utils/ReactTypefaceUtils.java +1 -2
- package/android/src/main/java/com/reactnativenavigation/utils/SystemUiUtils.kt +219 -54
- package/android/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java +3 -2
- package/android/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsPresenter.kt +26 -6
- package/android/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewController.java +6 -3
- package/android/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt +1 -2
- package/android/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/Presenter.java +3 -5
- package/android/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/ViewController.java +2 -6
- package/android/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsContainer.kt +5 -0
- package/android/src/test/java/com/reactnativenavigation/BaseRobolectricTest.kt +1 -1
- package/android/src/test/java/com/reactnativenavigation/BaseTest.kt +3 -2
- package/android/src/test/java/com/reactnativenavigation/ShadowReactView.java +45 -0
- package/android/src/test/java/com/reactnativenavigation/ShadowSoLoader.java +28 -0
- package/android/src/test/java/com/reactnativenavigation/TestApplication.kt +2 -2
- package/android/src/test/java/com/reactnativenavigation/mocks/SimpleViewController.java +14 -7
- package/android/src/test/java/com/reactnativenavigation/presentation/PresenterTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/utils/ButtonPresenterTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/utils/LayoutFactoryTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsApplyingTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabPresenterTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsControllerTest.kt +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsPresenterTest.kt +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewControllerTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/externalcomponent/ExternalComponentViewControllerTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalAnimatorTest.kt +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalPresenterTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalStackTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/RootPresenterTest.kt +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/overlay/OverlayManagerTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/parent/ParentControllerTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuControllerTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/BackButtonHelperTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/FloatingActionButtonTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackAnimatorTest.kt +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerTest.kt +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenterTest.kt +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/TitleBarButtonControllerTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/TitleBarReactViewControllerTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/TopBarButtonControllerTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/TopBarControllerTest.kt +0 -2
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabsViewControllerTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/viewcontrollers/viewcontroller/ViewControllerTest.java +0 -1
- package/android/src/test/java/com/reactnativenavigation/views/TitleAndButtonsContainerTest.kt +0 -1
- package/android/src/test/java/com/reactnativenavigation/views/TitleSubTitleLayoutTest.kt +0 -1
- package/ios/BottomTabsAppearancePresenter.mm +17 -5
- package/ios/RNNBottomTabsController.mm +1 -4
- package/ios/RNNCommandsHandler.mm +29 -23
- package/ios/RNNOverlayManager.mm +2 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/statusbar/StatusBarPresenter.kt +212 -0
- package/lib/module/events/EventsRegistry.test.js.map +1 -1
- package/package.json +2 -2
- package/src/events/EventsRegistry.test.tsx +3 -3
|
@@ -15,7 +15,7 @@ import org.robolectric.annotation.Config
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
@RunWith(RobolectricTestRunner::class)
|
|
18
|
-
@Config(application = TestApplication::class)
|
|
18
|
+
@Config(application = TestApplication::class, shadows = [ShadowSoLoader::class, ShadowReactView::class])
|
|
19
19
|
abstract class BaseRobolectricTest {
|
|
20
20
|
|
|
21
21
|
val context: Context = RuntimeEnvironment.getApplication()
|
|
@@ -19,6 +19,7 @@ import com.reactnativenavigation.utils.SystemUiUtils
|
|
|
19
19
|
import com.reactnativenavigation.utils.SystemUiUtils.getStatusBarHeight
|
|
20
20
|
import com.reactnativenavigation.utils.SystemUiUtils.getStatusBarHeightDp
|
|
21
21
|
import com.reactnativenavigation.utils.ViewUtils
|
|
22
|
+
import com.reactnativenavigation.viewcontrollers.statusbar.StatusBarPresenter
|
|
22
23
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController
|
|
23
24
|
import org.assertj.core.api.Java6Assertions
|
|
24
25
|
import org.junit.After
|
|
@@ -37,7 +38,7 @@ import org.robolectric.shadows.ShadowLooper
|
|
|
37
38
|
import java.util.Arrays
|
|
38
39
|
|
|
39
40
|
@RunWith(RobolectricTestRunner::class)
|
|
40
|
-
@Config(sdk = [28], application = TestApplication::class)
|
|
41
|
+
@Config(sdk = [28], application = TestApplication::class, shadows = [ShadowSoLoader::class, ShadowReactView::class])
|
|
41
42
|
abstract class BaseTest {
|
|
42
43
|
private val handler = Handler(Looper.getMainLooper())
|
|
43
44
|
private val shadowMainLooper: ShadowLooper = Shadows.shadowOf(Looper.getMainLooper())
|
|
@@ -49,7 +50,6 @@ abstract class BaseTest {
|
|
|
49
50
|
@Before
|
|
50
51
|
open fun beforeEach() {
|
|
51
52
|
mockReactNativeFeatureFlags = mockStatic(ReactNativeFeatureFlags::class.java)
|
|
52
|
-
mockReactNativeFeatureFlags?.close()
|
|
53
53
|
|
|
54
54
|
NavigationApplication.instance = Mockito.mock(NavigationApplication::class.java)
|
|
55
55
|
mockConfiguration = Mockito.mock(Configuration::class.java)
|
|
@@ -62,6 +62,7 @@ abstract class BaseTest {
|
|
|
62
62
|
.thenReturn(0x00000)
|
|
63
63
|
|
|
64
64
|
RNNFeatureToggles.init()
|
|
65
|
+
StatusBarPresenter.init(newActivity())
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
package com.reactnativenavigation;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.widget.FrameLayout;
|
|
5
|
+
|
|
6
|
+
import com.reactnativenavigation.react.ReactView;
|
|
7
|
+
|
|
8
|
+
import org.robolectric.annotation.Implementation;
|
|
9
|
+
import org.robolectric.annotation.Implements;
|
|
10
|
+
import org.robolectric.annotation.RealObject;
|
|
11
|
+
import org.robolectric.shadow.api.Shadow;
|
|
12
|
+
import org.robolectric.util.ReflectionHelpers;
|
|
13
|
+
import org.robolectric.util.ReflectionHelpers.ClassParameter;
|
|
14
|
+
|
|
15
|
+
@Implements(ReactView.class)
|
|
16
|
+
public class ShadowReactView extends org.robolectric.shadows.ShadowViewGroup {
|
|
17
|
+
|
|
18
|
+
@RealObject
|
|
19
|
+
private ReactView realObject;
|
|
20
|
+
|
|
21
|
+
@Implementation
|
|
22
|
+
protected void __constructor__(Context context, String componentId, String componentName) {
|
|
23
|
+
Shadow.invokeConstructor(FrameLayout.class, realObject,
|
|
24
|
+
ClassParameter.from(Context.class, context));
|
|
25
|
+
ReflectionHelpers.setField(realObject, "componentId", componentId);
|
|
26
|
+
ReflectionHelpers.setField(realObject, "componentName", componentName);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Implementation
|
|
30
|
+
protected void onAttachedToWindow() {
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Implementation
|
|
34
|
+
public void start() {
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@Implementation
|
|
38
|
+
public void destroy() {
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@Implementation
|
|
42
|
+
public boolean isRendered() {
|
|
43
|
+
return realObject.getChildCount() >= 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.reactnativenavigation;
|
|
2
|
+
|
|
3
|
+
import com.facebook.soloader.SoLoader;
|
|
4
|
+
|
|
5
|
+
import org.robolectric.annotation.Implementation;
|
|
6
|
+
import org.robolectric.annotation.Implements;
|
|
7
|
+
|
|
8
|
+
@Implements(SoLoader.class)
|
|
9
|
+
public class ShadowSoLoader {
|
|
10
|
+
|
|
11
|
+
@Implementation
|
|
12
|
+
public static boolean loadLibrary(String shortName) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Implementation
|
|
17
|
+
public static boolean loadLibrary(String shortName, int flags) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Implementation
|
|
22
|
+
public static void loadLibraryOnNonAndroid(String shortName) {
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@Implementation
|
|
26
|
+
public static void init(android.content.Context context, int flags) {
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -6,7 +6,7 @@ import com.facebook.react.ReactApplication
|
|
|
6
6
|
import com.facebook.react.ReactHost
|
|
7
7
|
import com.facebook.react.ReactNativeHost
|
|
8
8
|
import com.facebook.react.ReactPackage
|
|
9
|
-
import
|
|
9
|
+
import org.mockito.Mockito
|
|
10
10
|
|
|
11
11
|
class TestApplication : Application(), ReactApplication {
|
|
12
12
|
override val reactNativeHost: ReactNativeHost = object : ReactNativeHost(this) {
|
|
@@ -25,5 +25,5 @@ class TestApplication : Application(), ReactApplication {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
override val reactHost: ReactHost
|
|
28
|
-
get() =
|
|
28
|
+
get() = Mockito.mock(ReactHost::class.java)
|
|
29
29
|
}
|
|
@@ -8,9 +8,10 @@ import android.view.MotionEvent;
|
|
|
8
8
|
|
|
9
9
|
import androidx.annotation.NonNull;
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import android.view.ViewGroup;
|
|
12
|
+
import android.widget.FrameLayout;
|
|
13
|
+
|
|
12
14
|
import com.reactnativenavigation.options.Options;
|
|
13
|
-
import com.reactnativenavigation.react.ReactView;
|
|
14
15
|
import com.reactnativenavigation.viewcontrollers.child.ChildController;
|
|
15
16
|
import com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry;
|
|
16
17
|
import com.reactnativenavigation.viewcontrollers.component.ComponentPresenterBase;
|
|
@@ -18,8 +19,6 @@ import com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter;
|
|
|
18
19
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ScrollEventListener;
|
|
19
20
|
import com.reactnativenavigation.views.component.ReactComponent;
|
|
20
21
|
|
|
21
|
-
import org.mockito.Mockito;
|
|
22
|
-
|
|
23
22
|
public class SimpleViewController extends ChildController<SimpleViewController.SimpleView> {
|
|
24
23
|
private final ComponentPresenterBase presenter = new ComponentPresenterBase();
|
|
25
24
|
|
|
@@ -69,10 +68,10 @@ public class SimpleViewController extends ChildController<SimpleViewController.S
|
|
|
69
68
|
return null;
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
public static class SimpleView extends
|
|
71
|
+
public static class SimpleView extends FrameLayout implements ReactComponent {
|
|
73
72
|
|
|
74
73
|
public SimpleView(@NonNull Context context) {
|
|
75
|
-
super(context
|
|
74
|
+
super(context);
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
@Override
|
|
@@ -86,13 +85,21 @@ public class SimpleViewController extends ChildController<SimpleViewController.S
|
|
|
86
85
|
}
|
|
87
86
|
|
|
88
87
|
@Override
|
|
89
|
-
public
|
|
88
|
+
public ViewGroup asView() {
|
|
90
89
|
return this;
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
@Override
|
|
94
93
|
public void destroy() {}
|
|
95
94
|
|
|
95
|
+
@Override
|
|
96
|
+
protected void onAttachedToWindow() {
|
|
97
|
+
super.onAttachedToWindow();
|
|
98
|
+
start();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public void start() {}
|
|
102
|
+
|
|
96
103
|
@Override
|
|
97
104
|
public void sendOnNavigationButtonPressed(String buttonId) {}
|
|
98
105
|
|
|
@@ -40,7 +40,6 @@ import static org.mockito.Mockito.mock;
|
|
|
40
40
|
import static org.mockito.Mockito.spy;
|
|
41
41
|
import static org.mockito.Mockito.verify;
|
|
42
42
|
|
|
43
|
-
@Ignore("New architecture - WIP")
|
|
44
43
|
@LooperMode(LooperMode.Mode.PAUSED)
|
|
45
44
|
public class ButtonPresenterTest extends BaseTest {
|
|
46
45
|
private static final String BTN_TEXT = "button1";
|
|
@@ -20,7 +20,6 @@ import static org.assertj.core.api.Java6Assertions.fail;
|
|
|
20
20
|
import static org.mockito.Mockito.mock;
|
|
21
21
|
import static org.mockito.Mockito.when;
|
|
22
22
|
|
|
23
|
-
@Ignore("New architecture - WIP")
|
|
24
23
|
public class LayoutFactoryTest extends BaseTest {
|
|
25
24
|
private LayoutFactory uut;
|
|
26
25
|
private ReactHost reactHost;
|
package/android/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsApplyingTest.java
CHANGED
|
@@ -35,7 +35,6 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
|
|
35
35
|
import static org.assertj.core.api.Java6Assertions.assertThat;
|
|
36
36
|
import static org.mockito.Mockito.spy;
|
|
37
37
|
|
|
38
|
-
@Ignore("New architecture - WIP")
|
|
39
38
|
public class OptionsApplyingTest extends BaseTest {
|
|
40
39
|
private Activity activity;
|
|
41
40
|
private StackController stack;
|
|
@@ -41,7 +41,6 @@ import static org.mockito.Mockito.times;
|
|
|
41
41
|
import static org.mockito.Mockito.verify;
|
|
42
42
|
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
|
43
43
|
|
|
44
|
-
@Ignore("New architecture - WIP")
|
|
45
44
|
public class BottomTabPresenterTest extends BaseTest {
|
|
46
45
|
private Options tab1Options = createTab1Options();
|
|
47
46
|
private Options tab2Options = createTab2Options();
|
|
@@ -45,7 +45,6 @@ import org.mockito.kotlin.eq
|
|
|
45
45
|
import org.mockito.kotlin.times
|
|
46
46
|
import java.util.*
|
|
47
47
|
|
|
48
|
-
@Ignore("New architecture - WIP")
|
|
49
48
|
class BottomTabsControllerTest : BaseTest() {
|
|
50
49
|
private lateinit var activity: Activity
|
|
51
50
|
private lateinit var bottomTabs: BottomTabs
|
|
@@ -30,7 +30,6 @@ import org.mockito.kotlin.verify
|
|
|
30
30
|
import org.mockito.kotlin.verifyNoMoreInteractions
|
|
31
31
|
import org.mockito.kotlin.whenever
|
|
32
32
|
|
|
33
|
-
@Ignore("New architecture - WIP")
|
|
34
33
|
class BottomTabsPresenterTest : BaseTest() {
|
|
35
34
|
private lateinit var tabs: List<ViewController<*>>
|
|
36
35
|
private lateinit var uut: BottomTabsPresenter
|
|
@@ -20,7 +20,6 @@ import org.junit.Test;
|
|
|
20
20
|
import org.mockito.ArgumentMatchers;
|
|
21
21
|
import org.mockito.Mockito;
|
|
22
22
|
|
|
23
|
-
@Ignore("New architecture - WIP")
|
|
24
23
|
public class ComponentViewControllerTest extends BaseTest {
|
|
25
24
|
private ComponentViewController uut;
|
|
26
25
|
private ComponentLayout view;
|
|
@@ -25,7 +25,6 @@ import org.junit.Ignore;
|
|
|
25
25
|
import org.junit.Test;
|
|
26
26
|
import org.mockito.Mockito;
|
|
27
27
|
|
|
28
|
-
@Ignore("New architecture - WIP")
|
|
29
28
|
public class ExternalComponentViewControllerTest extends BaseTest {
|
|
30
29
|
private ExternalComponentViewController uut;
|
|
31
30
|
private FragmentCreatorMock componentCreator;
|
package/android/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalAnimatorTest.kt
CHANGED
|
@@ -14,7 +14,6 @@ import org.assertj.core.api.Java6Assertions.assertThat
|
|
|
14
14
|
import org.junit.Ignore
|
|
15
15
|
import org.junit.Test
|
|
16
16
|
|
|
17
|
-
@Ignore("New architecture - WIP")
|
|
18
17
|
class ModalAnimatorTest : BaseTest() {
|
|
19
18
|
private lateinit var uut: ModalAnimator
|
|
20
19
|
private lateinit var activity: Activity
|
|
@@ -37,7 +37,6 @@ import static org.mockito.Mockito.times;
|
|
|
37
37
|
import static org.mockito.Mockito.verify;
|
|
38
38
|
import static org.mockito.Mockito.verifyNoInteractions;
|
|
39
39
|
|
|
40
|
-
@Ignore("New architecture - WIP")
|
|
41
40
|
public class ModalPresenterTest extends BaseTest {
|
|
42
41
|
private static final String MODAL_ID_1 = "modalId1";
|
|
43
42
|
private static final String MODAL_ID_2 = "modalId2";
|
package/android/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalStackTest.java
CHANGED
|
@@ -35,7 +35,6 @@ import static org.mockito.Mockito.verify;
|
|
|
35
35
|
import static org.mockito.Mockito.verifyNoInteractions;
|
|
36
36
|
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
|
37
37
|
import static org.mockito.Mockito.when;
|
|
38
|
-
@Ignore("New architecture - WIP")
|
|
39
38
|
public class ModalStackTest extends BaseTest {
|
|
40
39
|
private static final String MODAL_ID_1 = "modalId1";
|
|
41
40
|
private static final String MODAL_ID_2 = "modalId2";
|
package/android/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java
CHANGED
|
@@ -63,7 +63,6 @@ import static org.mockito.Mockito.times;
|
|
|
63
63
|
import static org.mockito.Mockito.verify;
|
|
64
64
|
import static org.mockito.Mockito.when;
|
|
65
65
|
|
|
66
|
-
@Ignore("New architecture - WIP")
|
|
67
66
|
@Config(qualifiers = "xxhdpi")
|
|
68
67
|
public class NavigatorTest extends BaseTest {
|
|
69
68
|
private TestActivity activity;
|
|
@@ -25,7 +25,6 @@ import org.mockito.kotlin.eq
|
|
|
25
25
|
import org.mockito.kotlin.never
|
|
26
26
|
import org.robolectric.android.controller.ActivityController
|
|
27
27
|
|
|
28
|
-
@Ignore("New architecture - WIP")
|
|
29
28
|
class RootPresenterTest : BaseTest() {
|
|
30
29
|
private lateinit var uut: RootPresenter
|
|
31
30
|
private lateinit var rootContainer: CoordinatorLayout
|
|
@@ -21,7 +21,6 @@ import static org.mockito.Mockito.spy;
|
|
|
21
21
|
import static org.mockito.Mockito.times;
|
|
22
22
|
import static org.mockito.Mockito.verify;
|
|
23
23
|
|
|
24
|
-
@Ignore("New architecture - WIP")
|
|
25
24
|
public class OverlayManagerTest extends BaseTest {
|
|
26
25
|
private static final String OVERLAY_ID_1 = "OVERLAY_1";
|
|
27
26
|
private static final String OVERLAY_ID_2 = "OVERLAY_2";
|
|
@@ -37,7 +37,6 @@ import static org.mockito.Mockito.times;
|
|
|
37
37
|
import static org.mockito.Mockito.verify;
|
|
38
38
|
import static org.mockito.Mockito.when;
|
|
39
39
|
|
|
40
|
-
@Ignore("New architecture - WIP")
|
|
41
40
|
public class ParentControllerTest extends BaseTest {
|
|
42
41
|
|
|
43
42
|
private static final String INITIAL_TITLE = "initial title";
|
|
@@ -21,7 +21,6 @@ import static org.mockito.ArgumentMatchers.any;
|
|
|
21
21
|
import static org.mockito.Mockito.spy;
|
|
22
22
|
import static org.mockito.Mockito.times;
|
|
23
23
|
import static org.mockito.Mockito.verify;
|
|
24
|
-
@Ignore("New architecture - WIP")
|
|
25
24
|
public class BackButtonHelperTest extends BaseTest {
|
|
26
25
|
private BackButtonHelper uut;
|
|
27
26
|
private StackController stack;
|
package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackAnimatorTest.kt
CHANGED
|
@@ -18,7 +18,6 @@ import org.assertj.core.api.Java6Assertions.assertThat
|
|
|
18
18
|
import org.junit.Ignore
|
|
19
19
|
import org.junit.Test
|
|
20
20
|
|
|
21
|
-
@Ignore("New architecture - WIP")
|
|
22
21
|
class StackAnimatorTest : BaseTest() {
|
|
23
22
|
private lateinit var uut: StackAnimator
|
|
24
23
|
private lateinit var activity: Activity
|
package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerTest.kt
CHANGED
|
@@ -40,7 +40,6 @@ import org.robolectric.shadows.ShadowLooper
|
|
|
40
40
|
import java.util.*
|
|
41
41
|
import kotlin.test.fail
|
|
42
42
|
|
|
43
|
-
@Ignore("New architecture - WIP")
|
|
44
43
|
class StackControllerTest : BaseTest() {
|
|
45
44
|
private lateinit var activity: Activity
|
|
46
45
|
private lateinit var childRegistry: ChildControllersRegistry
|
package/android/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenterTest.kt
CHANGED
|
@@ -41,7 +41,6 @@ import org.robolectric.shadows.ShadowLooper
|
|
|
41
41
|
import java.util.*
|
|
42
42
|
import kotlin.collections.ArrayList
|
|
43
43
|
|
|
44
|
-
@Ignore("New architecture - WIP")
|
|
45
44
|
class StackPresenterTest : BaseTest() {
|
|
46
45
|
private lateinit var parent: StackController
|
|
47
46
|
private lateinit var uut: StackPresenter
|
|
@@ -19,7 +19,6 @@ import org.mockito.Mockito;
|
|
|
19
19
|
|
|
20
20
|
import static org.assertj.core.api.Java6Assertions.assertThat;
|
|
21
21
|
|
|
22
|
-
@Ignore("New architecture - WIP")
|
|
23
22
|
public class TitleBarButtonControllerTest extends BaseTest {
|
|
24
23
|
private ButtonController uut;
|
|
25
24
|
private ButtonBar titleBar;
|
|
@@ -14,7 +14,6 @@ import org.junit.Test;
|
|
|
14
14
|
import static org.mockito.Mockito.spy;
|
|
15
15
|
import static org.mockito.Mockito.verify;
|
|
16
16
|
|
|
17
|
-
@Ignore("New architecture - WIP")
|
|
18
17
|
public class TitleBarReactViewControllerTest extends BaseTest {
|
|
19
18
|
|
|
20
19
|
private TitleBarReactViewController uut;
|
|
@@ -31,7 +31,6 @@ import static org.mockito.Mockito.spy;
|
|
|
31
31
|
import static org.mockito.Mockito.times;
|
|
32
32
|
import static org.mockito.Mockito.verify;
|
|
33
33
|
|
|
34
|
-
@Ignore("New architecture - WIP")
|
|
35
34
|
@SuppressWarnings("MagicNumber")
|
|
36
35
|
public class TopBarButtonControllerTest extends BaseTest {
|
|
37
36
|
|
|
@@ -35,7 +35,6 @@ import java.util.*
|
|
|
35
35
|
|
|
36
36
|
private const val BKG_COLOR = 0x010203
|
|
37
37
|
|
|
38
|
-
@Ignore("New architecture - WIP")
|
|
39
38
|
class TopBarControllerTest : BaseTest() {
|
|
40
39
|
private lateinit var uut: TopBarController
|
|
41
40
|
private lateinit var activity: Activity
|
|
@@ -51,7 +50,6 @@ class TopBarControllerTest : BaseTest() {
|
|
|
51
50
|
|
|
52
51
|
override fun beforeEach() {
|
|
53
52
|
super.beforeEach()
|
|
54
|
-
|
|
55
53
|
activity = newActivity()
|
|
56
54
|
appearAnimator = spy(TopBarAppearanceAnimator())
|
|
57
55
|
colorAnimator = mock<ColorAnimator>()
|
|
@@ -40,7 +40,6 @@ import static org.mockito.Mockito.spy;
|
|
|
40
40
|
import static org.mockito.Mockito.times;
|
|
41
41
|
import static org.mockito.Mockito.verify;
|
|
42
42
|
|
|
43
|
-
@Ignore("New architecture - WIP")
|
|
44
43
|
public class TopTabsViewControllerTest extends BaseTest {
|
|
45
44
|
private static final int SIZE = 2;
|
|
46
45
|
|
|
@@ -40,7 +40,6 @@ import static org.mockito.Mockito.times;
|
|
|
40
40
|
import static org.mockito.Mockito.verify;
|
|
41
41
|
import static org.mockito.Mockito.withSettings;
|
|
42
42
|
|
|
43
|
-
@Ignore("New architecture - WIP")
|
|
44
43
|
public class ViewControllerTest extends BaseTest {
|
|
45
44
|
|
|
46
45
|
private ViewController uut;
|
package/android/src/test/java/com/reactnativenavigation/views/TitleAndButtonsContainerTest.kt
CHANGED
|
@@ -30,7 +30,6 @@ import kotlin.test.assertFalse
|
|
|
30
30
|
private const val UUT_WIDTH = 1000
|
|
31
31
|
private const val UUT_HEIGHT = 100
|
|
32
32
|
|
|
33
|
-
@Ignore("New architecture - failed to fix")
|
|
34
33
|
class TitleAndButtonsContainerTest : BaseTest() {
|
|
35
34
|
lateinit var uut: TitleAndButtonsContainer
|
|
36
35
|
private lateinit var activity: Activity
|
|
@@ -8,8 +8,15 @@
|
|
|
8
8
|
|
|
9
9
|
- (void)applyBackgroundColor:(UIColor *)backgroundColor translucent:(BOOL)translucent {
|
|
10
10
|
if (@available(iOS 26.0, *)) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
if (backgroundColor) {
|
|
12
|
+
if (backgroundColor.isTransparent) {
|
|
13
|
+
[self setTabBarTransparentBackground];
|
|
14
|
+
} else {
|
|
15
|
+
[self setTabBarBackgroundColor:backgroundColor];
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
[self setTabBarDefaultBackground];
|
|
19
|
+
}
|
|
13
20
|
return;
|
|
14
21
|
}
|
|
15
22
|
if (translucent)
|
|
@@ -61,8 +68,9 @@
|
|
|
61
68
|
|
|
62
69
|
- (void)setTabBarDefaultBackground {
|
|
63
70
|
if (@available(iOS 26.0, *)) {
|
|
64
|
-
[
|
|
65
|
-
|
|
71
|
+
UITabBarAppearance *appearance = [UITabBarAppearance new];
|
|
72
|
+
[appearance configureWithDefaultBackground];
|
|
73
|
+
[self applyTabBarAppearance:appearance];
|
|
66
74
|
} else {
|
|
67
75
|
[self setTabBarOpaqueBackground];
|
|
68
76
|
}
|
|
@@ -95,7 +103,11 @@
|
|
|
95
103
|
|
|
96
104
|
- (UITabBarAppearance *)appearanceWithColor:(UIColor *)color {
|
|
97
105
|
UITabBarAppearance *appearance = [UITabBarAppearance new];
|
|
98
|
-
|
|
106
|
+
if (@available(iOS 26.0, *)) {
|
|
107
|
+
[appearance configureWithTransparentBackground];
|
|
108
|
+
} else {
|
|
109
|
+
[appearance configureWithOpaqueBackground];
|
|
110
|
+
}
|
|
99
111
|
appearance.backgroundEffect = nil;
|
|
100
112
|
appearance.shadowColor = nil;
|
|
101
113
|
UIColor *resolvedColor = color ?: UIColor.systemBackgroundColor;
|
|
@@ -51,12 +51,9 @@
|
|
|
51
51
|
|
|
52
52
|
if (@available(iOS 26.0, *)) {
|
|
53
53
|
UITabBarAppearance *appearance = [UITabBarAppearance new];
|
|
54
|
-
[appearance
|
|
55
|
-
appearance.backgroundEffect = nil;
|
|
56
|
-
appearance.backgroundColor = UIColor.clearColor;
|
|
54
|
+
[appearance configureWithDefaultBackground];
|
|
57
55
|
self.tabBar.standardAppearance = appearance;
|
|
58
56
|
self.tabBar.scrollEdgeAppearance = [appearance copy];
|
|
59
|
-
self.tabBar.barTintColor = UIColor.clearColor;
|
|
60
57
|
} else if (@available(iOS 13.0, *)) {
|
|
61
58
|
UITabBarAppearance *appearance = [UITabBarAppearance new];
|
|
62
59
|
[appearance configureWithOpaqueBackground];
|
|
@@ -118,14 +118,18 @@ static NSString *const setDefaultOptions = @"setDefaultOptions";
|
|
|
118
118
|
|
|
119
119
|
UIViewController<RNNLayoutProtocol> *vc = [_layoutManager findComponentForId:componentId];
|
|
120
120
|
RNNNavigationOptions *newOptions = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
|
|
121
|
-
if ([vc conformsToProtocol:@protocol(RNNLayoutProtocol)] ||
|
|
122
|
-
|
|
121
|
+
if (vc && ([vc conformsToProtocol:@protocol(RNNLayoutProtocol)] ||
|
|
122
|
+
[vc isKindOfClass:[RNNComponentViewController class]])) {
|
|
123
123
|
[CATransaction begin];
|
|
124
124
|
[CATransaction setCompletionBlock:completion];
|
|
125
125
|
|
|
126
126
|
[vc mergeOptions:newOptions];
|
|
127
127
|
|
|
128
128
|
[CATransaction commit];
|
|
129
|
+
} else {
|
|
130
|
+
if (completion) {
|
|
131
|
+
completion();
|
|
132
|
+
}
|
|
129
133
|
}
|
|
130
134
|
}
|
|
131
135
|
|
|
@@ -324,10 +328,10 @@ static NSString *const setDefaultOptions = @"setDefaultOptions";
|
|
|
324
328
|
|
|
325
329
|
RNNComponentViewController *vc =
|
|
326
330
|
(RNNComponentViewController *)[_layoutManager findComponentForId:componentId];
|
|
327
|
-
RNNNavigationOptions *options = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
|
|
328
|
-
[vc mergeOptions:options];
|
|
329
|
-
|
|
330
331
|
if (vc) {
|
|
332
|
+
RNNNavigationOptions *options = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
|
|
333
|
+
[vc mergeOptions:options];
|
|
334
|
+
|
|
331
335
|
[vc.stack popTo:vc
|
|
332
336
|
animated:[vc.resolveOptionsWithDefault.animations.pop.enable withDefault:YES]
|
|
333
337
|
completion:^(NSArray *poppedViewControllers) {
|
|
@@ -355,25 +359,27 @@ static NSString *const setDefaultOptions = @"setDefaultOptions";
|
|
|
355
359
|
|
|
356
360
|
RNNComponentViewController *vc =
|
|
357
361
|
(RNNComponentViewController *)[_layoutManager findComponentForId:componentId];
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
[CATransaction begin];
|
|
362
|
-
[CATransaction setCompletionBlock:^{
|
|
363
|
-
[self->_eventEmitter sendOnNavigationCommandCompletion:popToRoot commandId:commandId];
|
|
364
|
-
completion();
|
|
365
|
-
}];
|
|
366
|
-
|
|
367
|
-
[vc.stack popToRoot:vc
|
|
368
|
-
animated:[vc.resolveOptionsWithDefault.animations.pop.enable withDefault:YES]
|
|
369
|
-
completion:^(NSArray *poppedViewControllers) {
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
rejection:^(NSString *code, NSString *message, NSError *error){
|
|
373
|
-
|
|
374
|
-
}];
|
|
362
|
+
if (vc) {
|
|
363
|
+
RNNNavigationOptions *options = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
|
|
364
|
+
[vc mergeOptions:options];
|
|
375
365
|
|
|
376
|
-
|
|
366
|
+
[vc.stack popToRoot:vc
|
|
367
|
+
animated:[vc.resolveOptionsWithDefault.animations.pop.enable withDefault:YES]
|
|
368
|
+
completion:^(NSArray *poppedViewControllers) {
|
|
369
|
+
[self->_eventEmitter sendOnNavigationCommandCompletion:popToRoot
|
|
370
|
+
commandId:commandId];
|
|
371
|
+
completion();
|
|
372
|
+
}
|
|
373
|
+
rejection:rejection];
|
|
374
|
+
} else {
|
|
375
|
+
[RNNErrorHandler
|
|
376
|
+
reject:rejection
|
|
377
|
+
withErrorCode:1012
|
|
378
|
+
errorDescription:
|
|
379
|
+
[NSString stringWithFormat:
|
|
380
|
+
@"PopToRoot component failed - componentId '%@' not found",
|
|
381
|
+
componentId]];
|
|
382
|
+
}
|
|
377
383
|
}
|
|
378
384
|
|
|
379
385
|
- (void)showModal:(NSDictionary *)layout
|
package/ios/RNNOverlayManager.mm
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
[overlayWindow setHidden:NO];
|
|
20
20
|
|
|
21
21
|
overlayWindow.previousWindow.accessibilityElementsHidden = YES;
|
|
22
|
+
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, overlayWindow);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
- (void)showOverlayWindowAsKeyWindow:(RNNOverlayWindow *)overlayWindow {
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
|
|
42
43
|
- (void)detachOverlayWindow:(RNNOverlayWindow *)overlayWindow {
|
|
43
44
|
overlayWindow.previousWindow.accessibilityElementsHidden = NO;
|
|
45
|
+
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil);
|
|
44
46
|
|
|
45
47
|
[overlayWindow.previousWindow makeKeyWindow];
|
|
46
48
|
[overlayWindow setHidden:YES];
|