react-native-navigation 7.23.1 → 7.24.0
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/.buildkite/pipeline.yml +51 -11
- package/.nvmrc +1 -0
- package/Mock.d.ts +1 -0
- package/Mock.js +4 -0
- package/Mock.ts +1 -1
- package/README.md +0 -1
- package/jest.config.js +40 -0
- package/lib/{src/Mock → Mock}/Application.tsx +0 -0
- package/lib/{src/Mock → Mock}/ComponentProps.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/BottomTabs.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/ComponentScreen.tsx +13 -2
- package/lib/{src/Mock → Mock}/Components/LayoutComponent.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/Modals.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/NavigationButton.tsx +1 -1
- package/lib/{src/Mock → Mock}/Components/Overlays.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/Stack.tsx +0 -0
- package/lib/{src/Mock → Mock}/Components/TopBar.tsx +2 -2
- package/lib/{src/Mock → Mock}/Layouts/BottomTabsNode.ts +1 -1
- package/lib/{src/Mock → Mock}/Layouts/ComponentNode.ts +1 -1
- package/lib/{src/Mock → Mock}/Layouts/LayoutNodeFactory.ts +0 -0
- package/lib/{src/Mock → Mock}/Layouts/Node.ts +1 -1
- package/lib/{src/Mock → Mock}/Layouts/ParentNode.ts +2 -2
- package/lib/{src/Mock → Mock}/Layouts/StackNode.ts +0 -0
- package/lib/{src/Mock → Mock}/Stores/EventsStore.ts +10 -2
- package/lib/{src/Mock → Mock}/Stores/LayoutStore.ts +3 -2
- package/lib/{src/Mock → Mock}/connect.ts +0 -0
- package/lib/Mock/constants.d.ts +2 -0
- package/lib/Mock/constants.js +5 -0
- package/lib/{src/Mock → Mock}/constants.ts +0 -0
- package/lib/Mock/index.d.ts +3 -0
- package/lib/Mock/index.js +14 -0
- package/lib/{src/Mock → Mock}/index.ts +0 -0
- package/lib/{src/Mock → Mock}/mocks/AppRegistryService.ts +0 -0
- package/lib/{src/Mock → Mock}/mocks/NativeCommandsSender.tsx +1 -1
- package/lib/{src/Mock → Mock}/mocks/NativeEventsReceiver.ts +7 -4
- package/lib/android/app/build.gradle +23 -21
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/FontOptions.kt +2 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/HardwareBackButtonOptions.kt +35 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/LayoutFactory.java +32 -17
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/Options.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/parsers/TypefaceLoader.kt +16 -10
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java +5 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalFrameLayout.kt +3 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalViewManager.kt +11 -8
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/SystemUiUtils.kt +168 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabPresenter.java +5 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java +42 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/child/ChildController.java +12 -16
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewController.java +19 -11
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/externalcomponent/ExternalComponentViewController.java +2 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalPresenter.java +6 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/overlay/OverlayManager.kt +8 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java +15 -7
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenter.java +127 -138
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/TopBarController.kt +183 -22
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonController.kt +25 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonPresenter.kt +9 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonSpan.kt +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/Presenter.java +52 -71
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/component/ComponentLayout.java +2 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/ReactImageMatrixAnimator.kt +2 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/TopBar.java +1 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/ButtonBar.kt +7 -12
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleAndButtonsContainer.kt +0 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleSubTitleLayout.kt +0 -7
- package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +2 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/BaseTest.java +7 -6
- package/lib/android/app/src/test/java/com/reactnativenavigation/TestActivity.java +5 -0
- package/lib/android/app/src/test/java/com/reactnativenavigation/mocks/ImageLoaderMock.kt +5 -4
- package/lib/android/app/src/test/java/com/reactnativenavigation/mocks/Mocks.kt +3 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/mocks/TypefaceLoaderMock.kt +5 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/options/TransitionAnimationOptionsTest.kt +2 -3
- package/lib/android/app/src/test/java/com/reactnativenavigation/presentation/PresenterTest.java +25 -10
- package/lib/android/app/src/test/java/com/reactnativenavigation/utils/LayoutFactoryTest.java +25 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/utils/MotionEventTest.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/utils/{TitleAndButtonsMeasurer.kt → TitleAndButtonsMeasurerTest.kt} +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/utils/UiThreadTest.java +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/utils/UiUtilsTest.java +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsControllerTest.kt +572 -0
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsPresenterTest.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/child/ChildControllerTest.java +2 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewControllerTest.java +5 -5
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/fakes/FakeParentController.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalAnimatorTest.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalPresenterTest.java +7 -3
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalStackTest.java +17 -4
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/RootPresenterTest.kt +5 -5
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/overlay/OverlayManagerTest.java +1 -0
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/parent/ParentControllerTest.java +4 -0
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuControllerTest.java +6 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackAnimatorTest.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerTest.kt +13 -8
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenterTest.kt +58 -51
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/TopBarControllerTest.kt +219 -41
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/viewcontroller/ViewControllerTest.java +4 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/views/TitleAndButtonsContainerTest.kt +2 -2
- package/lib/android/app/src/test/java/com/reactnativenavigation/views/animations/BaseViewAnimatorTest.kt +4 -4
- package/lib/android/app/src/test/java/com/reactnativenavigation/views/bottomtabs/BottomTabsContainerTest.kt +1 -1
- package/lib/android/app/src/test/java/com/reactnativenavigation/views/bottomtabs/BottomTabsTest.kt +4 -4
- package/lib/dist/Mock/Application.js +2 -2
- package/lib/dist/Mock/Components/BottomTabs.js +2 -2
- package/lib/dist/Mock/Components/ComponentScreen.js +15 -5
- package/lib/dist/Mock/Components/LayoutComponent.js +3 -2
- package/lib/dist/Mock/Components/Modals.js +2 -2
- package/lib/dist/Mock/Components/NavigationButton.d.ts +1 -1
- package/lib/dist/Mock/Components/NavigationButton.js +8 -10
- package/lib/dist/Mock/Components/Overlays.js +2 -2
- package/lib/dist/Mock/Components/Stack.js +2 -2
- package/lib/dist/Mock/Components/TopBar.d.ts +2 -2
- package/lib/dist/Mock/Components/TopBar.js +7 -6
- package/lib/dist/Mock/Layouts/BottomTabsNode.d.ts +1 -1
- package/lib/dist/Mock/Layouts/BottomTabsNode.js +3 -3
- package/lib/dist/Mock/Layouts/ComponentNode.d.ts +1 -1
- package/lib/dist/Mock/Layouts/ComponentNode.js +4 -4
- package/lib/dist/Mock/Layouts/LayoutNodeFactory.js +3 -3
- package/lib/dist/Mock/Layouts/Node.d.ts +1 -1
- package/lib/dist/Mock/Layouts/Node.js +5 -0
- package/lib/dist/Mock/Layouts/ParentNode.d.ts +2 -2
- package/lib/dist/Mock/Layouts/ParentNode.js +4 -3
- package/lib/dist/Mock/Layouts/StackNode.js +1 -1
- package/lib/dist/Mock/Stores/EventsStore.d.ts +5 -2
- package/lib/dist/Mock/Stores/EventsStore.js +7 -0
- package/lib/dist/Mock/Stores/LayoutStore.js +6 -3
- package/lib/dist/Mock/connect.js +1 -1
- package/lib/dist/Mock/index.js +1 -1
- package/lib/dist/Mock/mocks/NativeCommandsSender.d.ts +1 -1
- package/lib/dist/Mock/mocks/NativeCommandsSender.js +2 -2
- package/lib/dist/Mock/mocks/NativeEventsReceiver.d.ts +3 -3
- package/lib/dist/Mock/mocks/NativeEventsReceiver.js +6 -3
- package/lib/dist/{Navigation.d.ts → src/Navigation.d.ts} +0 -0
- package/lib/dist/{Navigation.js → src/Navigation.js} +19 -3
- package/lib/dist/{NavigationDelegate.d.ts → src/NavigationDelegate.d.ts} +0 -0
- package/lib/dist/{NavigationDelegate.js → src/NavigationDelegate.js} +1 -0
- package/lib/dist/{adapters → src/adapters}/AppRegistryService.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/AppRegistryService.js +0 -0
- package/lib/dist/{adapters → src/adapters}/AssetResolver.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/AssetResolver.js +0 -0
- package/lib/dist/src/adapters/ColorService.d.ts +3 -0
- package/lib/dist/{adapters → src/adapters}/ColorService.js +1 -1
- package/lib/dist/{adapters → src/adapters}/Constants.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/Constants.js +10 -6
- package/lib/dist/{adapters → src/adapters}/NativeCommandsSender.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/NativeCommandsSender.js +1 -0
- package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.js +1 -0
- package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.mock.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.mock.js +0 -0
- package/lib/dist/{adapters → src/adapters}/TouchablePreview.d.ts +0 -0
- package/lib/dist/src/adapters/TouchablePreview.js +89 -0
- package/lib/dist/{adapters → src/adapters}/UniqueIdProvider.d.ts +0 -0
- package/lib/dist/{adapters → src/adapters}/UniqueIdProvider.js +2 -2
- package/lib/dist/{commands → src/commands}/Commands.d.ts +0 -0
- package/lib/dist/{commands → src/commands}/Commands.js +24 -10
- package/lib/dist/{commands → src/commands}/Deprecations.d.ts +0 -0
- package/lib/dist/src/commands/Deprecations.js +80 -0
- package/lib/dist/{commands → src/commands}/LayoutTreeCrawler.d.ts +0 -0
- package/lib/dist/{commands → src/commands}/LayoutTreeCrawler.js +4 -2
- package/lib/dist/{commands → src/commands}/LayoutTreeParser.d.ts +0 -0
- package/lib/dist/{commands → src/commands}/LayoutTreeParser.js +1 -0
- package/lib/dist/{commands → src/commands}/LayoutType.d.ts +0 -0
- package/lib/dist/{commands → src/commands}/LayoutType.js +0 -0
- package/lib/dist/{commands → src/commands}/OptionsCrawler.d.ts +0 -0
- package/lib/dist/{commands → src/commands}/OptionsCrawler.js +6 -4
- package/lib/dist/{commands → src/commands}/OptionsProcessor.d.ts +1 -1
- package/lib/dist/{commands → src/commands}/OptionsProcessor.js +50 -42
- package/lib/dist/{components → src/components}/ComponentRegistry.d.ts +0 -0
- package/lib/dist/{components → src/components}/ComponentRegistry.js +4 -0
- package/lib/dist/{components → src/components}/ComponentWrapper.d.ts +0 -0
- package/lib/dist/{components → src/components}/ComponentWrapper.js +17 -17
- package/lib/dist/{components → src/components}/Modal.d.ts +0 -0
- package/lib/dist/{components → src/components}/Modal.js +8 -8
- package/lib/dist/{components → src/components}/Store.d.ts +2 -0
- package/lib/dist/{components → src/components}/Store.js +13 -6
- package/lib/dist/{events → src/events}/CommandsObserver.d.ts +0 -0
- package/lib/dist/{events → src/events}/CommandsObserver.js +2 -1
- package/lib/dist/{events → src/events}/ComponentEventsObserver.d.ts +4 -2
- package/lib/dist/{events → src/events}/ComponentEventsObserver.js +16 -14
- package/lib/dist/{events → src/events}/EventsRegistry.d.ts +2 -2
- package/lib/dist/{events → src/events}/EventsRegistry.js +3 -0
- package/lib/dist/{index.d.ts → src/index.d.ts} +0 -0
- package/lib/dist/src/index.js +22 -0
- package/lib/dist/{interfaces → src/interfaces}/CommandName.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/CommandName.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/ComponentEvents.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/ComponentEvents.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/EventSubscription.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/EventSubscription.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Events.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Events.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Layout.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Layout.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponent.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponent.js +8 -1
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponentListener.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponentListener.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponentProps.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationComponentProps.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationFunctionComponent.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/NavigationFunctionComponent.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Options.d.ts +9 -0
- package/lib/dist/{interfaces → src/interfaces}/Options.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/ProcessorSubscription.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/ProcessorSubscription.js +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Processors.d.ts +0 -0
- package/lib/dist/{interfaces → src/interfaces}/Processors.js +0 -0
- package/lib/dist/{processors → src/processors}/LayoutProcessor.d.ts +0 -0
- package/lib/dist/{processors → src/processors}/LayoutProcessor.js +1 -0
- package/lib/dist/{processors → src/processors}/LayoutProcessorsStore.d.ts +0 -0
- package/lib/dist/{processors → src/processors}/LayoutProcessorsStore.js +1 -3
- package/lib/dist/{processors → src/processors}/OptionProcessorsStore.d.ts +0 -0
- package/lib/dist/{processors → src/processors}/OptionProcessorsStore.js +1 -3
- package/lib/dist/{types.d.ts → src/types.d.ts} +0 -0
- package/lib/dist/{types.js → src/types.js} +0 -0
- package/lib/ios/AnimationObserver.h +17 -0
- package/lib/ios/AnimationObserver.m +41 -0
- package/lib/ios/BottomTabPresenter.h +0 -3
- package/lib/ios/BottomTabPresenter.m +0 -8
- package/lib/ios/RNNAssert.h +2 -2
- package/lib/ios/RNNBasePresenter.h +0 -4
- package/lib/ios/RNNBasePresenter.m +0 -12
- package/lib/ios/RNNBottomTabOptions.m +2 -1
- package/lib/ios/RNNBottomTabsController.m +8 -8
- package/lib/ios/RNNBridgeManager.mm +0 -1
- package/lib/ios/RNNButtonBuilder.m +2 -0
- package/lib/ios/RNNButtonOptions.h +1 -0
- package/lib/ios/RNNButtonOptions.m +4 -0
- package/lib/ios/RNNCommandsHandler.m +15 -8
- package/lib/ios/RNNComponentPresenter.m +0 -4
- package/lib/ios/RNNComponentViewController.m +2 -4
- package/lib/ios/RNNDotIndicatorPresenter.m +2 -1
- package/lib/ios/RNNExternalViewController.m +2 -4
- package/lib/ios/RNNModalManager.h +2 -1
- package/lib/ios/RNNModalManager.m +12 -21
- package/lib/ios/RNNSegmentedControl.h +1 -1
- package/lib/ios/RNNSideMenuChildVC.m +0 -4
- package/lib/ios/RNNSideMenuController.m +0 -4
- package/lib/ios/RNNSplitViewController.m +0 -4
- package/lib/ios/RNNStackController.m +0 -4
- package/lib/ios/RNNStackPresenter.m +3 -0
- package/lib/ios/RNNSwizzles.m +20 -0
- package/lib/ios/RNNTabBarItemCreator.m +3 -2
- package/lib/ios/RNNUIBarButtonItem.h +2 -0
- package/lib/ios/RNNUIBarButtonItem.m +17 -0
- package/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj +8 -0
- package/lib/ios/TopBarPresenter.m +8 -4
- package/lib/ios/UIViewController+RNNOptions.m +1 -1
- package/lib/src/commands/Commands.ts +6 -1
- package/lib/src/commands/LayoutTreeCrawler.ts +2 -2
- package/lib/src/commands/OptionsCrawler.ts +2 -1
- package/lib/src/commands/OptionsProcessor.ts +15 -13
- package/lib/src/components/Store.ts +9 -0
- package/lib/src/events/ComponentEventsObserver.ts +5 -1
- package/lib/src/events/EventsRegistry.ts +2 -1
- package/lib/src/interfaces/Options.ts +10 -0
- package/package.json +19 -60
- package/tsconfig.mocks.json +7 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/StatusBarUtils.java +0 -41
- package/lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsControllerTest.java +0 -511
- package/lib/dist/adapters/ColorService.d.ts +0 -3
- package/lib/dist/adapters/TouchablePreview.js +0 -91
- package/lib/dist/commands/Deprecations.js +0 -82
- package/lib/dist/index.js +0 -22
|
@@ -2,12 +2,16 @@ package com.reactnativenavigation.viewcontrollers.child;
|
|
|
2
2
|
|
|
3
3
|
import android.app.Activity;
|
|
4
4
|
import android.content.res.Configuration;
|
|
5
|
+
import android.os.Build;
|
|
6
|
+
import android.util.Log;
|
|
5
7
|
import android.view.View;
|
|
6
8
|
import android.view.ViewGroup;
|
|
9
|
+
import android.view.WindowInsets;
|
|
7
10
|
|
|
8
11
|
import com.reactnativenavigation.options.Options;
|
|
12
|
+
import com.reactnativenavigation.utils.LogKt;
|
|
13
|
+
import com.reactnativenavigation.viewcontrollers.parent.ParentController;
|
|
9
14
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter;
|
|
10
|
-
import com.reactnativenavigation.utils.StatusBarUtils;
|
|
11
15
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.NoOpYellowBoxDelegate;
|
|
12
16
|
import com.reactnativenavigation.viewcontrollers.navigator.Navigator;
|
|
13
17
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController;
|
|
@@ -15,7 +19,9 @@ import com.reactnativenavigation.viewcontrollers.viewcontroller.overlay.ViewCont
|
|
|
15
19
|
import com.reactnativenavigation.views.component.Component;
|
|
16
20
|
|
|
17
21
|
import androidx.annotation.CallSuper;
|
|
22
|
+
import androidx.core.graphics.Insets;
|
|
18
23
|
import androidx.core.view.ViewCompat;
|
|
24
|
+
import androidx.core.view.WindowCompat;
|
|
19
25
|
import androidx.core.view.WindowInsetsCompat;
|
|
20
26
|
|
|
21
27
|
public abstract class ChildController<T extends ViewGroup> extends ViewController<T> {
|
|
@@ -61,7 +67,7 @@ public abstract class ChildController<T extends ViewGroup> extends ViewControlle
|
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
public void onViewBroughtToFront() {
|
|
64
|
-
presenter.onViewBroughtToFront(resolveCurrentOptions());
|
|
70
|
+
presenter.onViewBroughtToFront(this, resolveCurrentOptions());
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
@Override
|
|
@@ -73,7 +79,7 @@ public abstract class ChildController<T extends ViewGroup> extends ViewControlle
|
|
|
73
79
|
@Override
|
|
74
80
|
public void mergeOptions(Options options) {
|
|
75
81
|
if (options == Options.EMPTY) return;
|
|
76
|
-
if (isViewShown()) presenter.mergeOptions(
|
|
82
|
+
if (isViewShown()) presenter.mergeOptions(this, options);
|
|
77
83
|
super.mergeOptions(options);
|
|
78
84
|
performOnParentController(parentController -> parentController.mergeChildOptions(options, this));
|
|
79
85
|
}
|
|
@@ -93,23 +99,13 @@ public abstract class ChildController<T extends ViewGroup> extends ViewControlle
|
|
|
93
99
|
getView().getParent() != null;
|
|
94
100
|
}
|
|
95
101
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return applyWindowInsets(findController(view), insets);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
protected WindowInsetsCompat applyWindowInsets(ViewController<?> view, WindowInsetsCompat insets) {
|
|
102
|
-
return insets.replaceSystemWindowInsets(
|
|
103
|
-
insets.getSystemWindowInsetLeft(),
|
|
104
|
-
0,
|
|
105
|
-
insets.getSystemWindowInsetRight(),
|
|
106
|
-
insets.getSystemWindowInsetBottom()
|
|
107
|
-
);
|
|
102
|
+
protected WindowInsetsCompat onApplyWindowInsets(View view, WindowInsetsCompat insets) {
|
|
103
|
+
return insets;
|
|
108
104
|
}
|
|
109
105
|
|
|
110
106
|
@Override
|
|
111
107
|
public void onConfigurationChanged(Configuration newConfig) {
|
|
112
108
|
super.onConfigurationChanged(newConfig);
|
|
113
|
-
presenter.onConfigurationChanged(this,options);
|
|
109
|
+
presenter.onConfigurationChanged(this, options);
|
|
114
110
|
}
|
|
115
111
|
}
|
|
@@ -4,10 +4,11 @@ import android.app.Activity;
|
|
|
4
4
|
import android.content.res.Configuration;
|
|
5
5
|
import android.view.View;
|
|
6
6
|
|
|
7
|
+
import com.reactnativenavigation.utils.LogKt;
|
|
7
8
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ScrollEventListener;
|
|
8
9
|
import com.reactnativenavigation.options.Options;
|
|
9
10
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter;
|
|
10
|
-
import com.reactnativenavigation.utils.
|
|
11
|
+
import com.reactnativenavigation.utils.SystemUiUtils;
|
|
11
12
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ReactViewCreator;
|
|
12
13
|
import com.reactnativenavigation.viewcontrollers.child.ChildController;
|
|
13
14
|
import com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry;
|
|
@@ -15,6 +16,7 @@ import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController;
|
|
|
15
16
|
import com.reactnativenavigation.views.component.ComponentLayout;
|
|
16
17
|
|
|
17
18
|
import androidx.annotation.NonNull;
|
|
19
|
+
import androidx.core.graphics.Insets;
|
|
18
20
|
import androidx.core.view.ViewCompat;
|
|
19
21
|
import androidx.core.view.WindowInsetsCompat;
|
|
20
22
|
|
|
@@ -126,8 +128,9 @@ public class ComponentViewController extends ChildController<ComponentLayout> {
|
|
|
126
128
|
|
|
127
129
|
@Override
|
|
128
130
|
public int getTopInset() {
|
|
129
|
-
int statusBarInset = resolveCurrentOptions(presenter.defaultOptions).statusBar.isHiddenOrDrawBehind() ? 0 :
|
|
130
|
-
|
|
131
|
+
int statusBarInset = resolveCurrentOptions(presenter.defaultOptions).statusBar.isHiddenOrDrawBehind() ? 0 : SystemUiUtils.getStatusBarHeight(getActivity());
|
|
132
|
+
final Integer perform = perform(getParentController(), 0, p -> p.getTopInset(this));
|
|
133
|
+
return statusBarInset + perform;
|
|
131
134
|
}
|
|
132
135
|
|
|
133
136
|
@Override
|
|
@@ -136,14 +139,19 @@ public class ComponentViewController extends ChildController<ComponentLayout> {
|
|
|
136
139
|
}
|
|
137
140
|
|
|
138
141
|
@Override
|
|
139
|
-
protected WindowInsetsCompat
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
))
|
|
146
|
-
|
|
142
|
+
protected WindowInsetsCompat onApplyWindowInsets(View view, WindowInsetsCompat insets) {
|
|
143
|
+
ViewController<?> viewController = findController(view);
|
|
144
|
+
if (viewController == null || viewController.getView() == null) return insets;
|
|
145
|
+
final Insets keyboardInsets = insets.getInsets( WindowInsetsCompat.Type.ime());
|
|
146
|
+
final Insets systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars() );
|
|
147
|
+
final int visibleNavBar = resolveCurrentOptions(presenter.defaultOptions).navigationBar.isVisible.isTrueOrUndefined()?1:0;
|
|
148
|
+
final WindowInsetsCompat finalInsets = new WindowInsetsCompat.Builder().setInsets(WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.ime(),
|
|
149
|
+
Insets.of(systemBarsInsets.left,
|
|
150
|
+
0,
|
|
151
|
+
systemBarsInsets.right,
|
|
152
|
+
Math.max(visibleNavBar*systemBarsInsets.bottom,keyboardInsets.bottom))
|
|
153
|
+
).build();
|
|
154
|
+
return ViewCompat.onApplyWindowInsets(viewController.getView(), finalInsets);
|
|
147
155
|
}
|
|
148
156
|
|
|
149
157
|
@Override
|
|
@@ -10,7 +10,7 @@ import com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter;
|
|
|
10
10
|
import com.reactnativenavigation.react.events.ComponentType;
|
|
11
11
|
import com.reactnativenavigation.react.events.EventEmitter;
|
|
12
12
|
import com.reactnativenavigation.utils.CoordinatorLayoutUtils;
|
|
13
|
-
import com.reactnativenavigation.utils.
|
|
13
|
+
import com.reactnativenavigation.utils.SystemUiUtils;
|
|
14
14
|
import com.reactnativenavigation.viewcontrollers.child.ChildController;
|
|
15
15
|
import com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry;
|
|
16
16
|
import com.reactnativenavigation.views.BehaviourDelegate;
|
|
@@ -72,7 +72,7 @@ public class ExternalComponentViewController extends ChildController<ExternalCom
|
|
|
72
72
|
|
|
73
73
|
@Override
|
|
74
74
|
public int getTopInset() {
|
|
75
|
-
int statusBarInset = resolveCurrentOptions().statusBar.drawBehind.isTrue() ? 0 :
|
|
75
|
+
int statusBarInset = resolveCurrentOptions().statusBar.drawBehind.isTrue() ? 0 : SystemUiUtils.getStatusBarHeight(getActivity());
|
|
76
76
|
return statusBarInset + perform(getParentController(), 0, p -> p.getTopInset(this));
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -90,10 +90,12 @@ public class ModalPresenter {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
private void onShowModalEnd(ViewController<?> toAdd, @Nullable ViewController<?> toRemove, CommandListener listener) {
|
|
93
|
-
toAdd.
|
|
94
|
-
|
|
95
|
-
toRemove.
|
|
96
|
-
|
|
93
|
+
toAdd.addOnAppearedListener(()->{
|
|
94
|
+
toAdd.onViewDidAppear();
|
|
95
|
+
if (toRemove != null && toAdd.resolveCurrentOptions(defaultOptions).modal.presentationStyle != ModalPresentationStyle.OverCurrentContext) {
|
|
96
|
+
toRemove.detachView();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
97
99
|
listener.onSuccess(toAdd.getId());
|
|
98
100
|
}
|
|
99
101
|
|
|
@@ -28,7 +28,7 @@ class OverlayManager {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
fun dismiss(overlaysContainer: ViewGroup, componentId: String, listener: CommandListener) {
|
|
31
|
-
val overlay = overlayRegistry
|
|
31
|
+
val overlay = overlayRegistry.remove(componentId)
|
|
32
32
|
if (overlay == null) {
|
|
33
33
|
listener.onError("Could not dismiss Overlay. Overlay with id $componentId was not found.")
|
|
34
34
|
} else {
|
|
@@ -43,7 +43,13 @@ class OverlayManager {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
fun destroy(overlaysContainer: ViewGroup) {
|
|
46
|
-
overlayRegistry.values.
|
|
46
|
+
val removedOverlays = overlayRegistry.values.map { overlay ->
|
|
47
|
+
destroyOverlay(overlaysContainer, overlay)
|
|
48
|
+
overlay.id
|
|
49
|
+
}.toList()
|
|
50
|
+
removedOverlays.forEach {
|
|
51
|
+
overlayRegistry.remove(it)
|
|
52
|
+
}
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
fun size() = overlayRegistry.size
|
|
@@ -54,7 +60,6 @@ class OverlayManager {
|
|
|
54
60
|
|
|
55
61
|
private fun destroyOverlay(overlaysContainer: ViewGroup, overlay: ViewController<*>) {
|
|
56
62
|
overlay.destroy()
|
|
57
|
-
overlayRegistry.remove(overlay.id)
|
|
58
63
|
if (isEmpty) overlaysContainer.visibility = View.GONE
|
|
59
64
|
}
|
|
60
65
|
|
|
@@ -5,6 +5,7 @@ import android.content.res.Configuration;
|
|
|
5
5
|
import android.view.View;
|
|
6
6
|
import android.view.ViewGroup;
|
|
7
7
|
|
|
8
|
+
import com.facebook.react.ReactRootView;
|
|
8
9
|
import com.reactnativenavigation.options.ButtonOptions;
|
|
9
10
|
import com.reactnativenavigation.options.Options;
|
|
10
11
|
import com.reactnativenavigation.options.StackAnimationOptions;
|
|
@@ -68,7 +69,7 @@ public class StackController extends ParentController<StackLayout> {
|
|
|
68
69
|
@Override
|
|
69
70
|
public void onConfigurationChanged(Configuration newConfig) {
|
|
70
71
|
super.onConfigurationChanged(newConfig);
|
|
71
|
-
presenter.onConfigurationChanged(resolveCurrentOptions());
|
|
72
|
+
presenter.onConfigurationChanged(resolveCurrentOptions(), getCurrentChild());
|
|
72
73
|
fabPresenter.onConfigurationChanged(resolveCurrentOptions());
|
|
73
74
|
}
|
|
74
75
|
|
|
@@ -175,9 +176,7 @@ public class StackController extends ParentController<StackLayout> {
|
|
|
175
176
|
presenter.getAdditionalPushAnimations(this, child, resolvedOptions),
|
|
176
177
|
() -> onPushAnimationComplete(child, toRemove, listener));
|
|
177
178
|
} else {
|
|
178
|
-
child
|
|
179
|
-
getView().removeView(toRemove.getView());
|
|
180
|
-
listener.onSuccess(child.getId());
|
|
179
|
+
onPushAnimationComplete(child, toRemove, listener);
|
|
181
180
|
}
|
|
182
181
|
} else {
|
|
183
182
|
listener.onSuccess(child.getId());
|
|
@@ -191,8 +190,10 @@ public class StackController extends ParentController<StackLayout> {
|
|
|
191
190
|
}
|
|
192
191
|
|
|
193
192
|
private void onPushAnimationComplete(ViewController<?> toAdd, ViewController<?> toRemove, CommandListener listener) {
|
|
194
|
-
toAdd.
|
|
195
|
-
|
|
193
|
+
toAdd.addOnAppearedListener(() -> {
|
|
194
|
+
toAdd.onViewDidAppear();
|
|
195
|
+
if (!peek().equals(toRemove)) getView().removeView(toRemove.getView());
|
|
196
|
+
});
|
|
196
197
|
listener.onSuccess(toAdd.getId());
|
|
197
198
|
}
|
|
198
199
|
|
|
@@ -421,12 +422,19 @@ public class StackController extends ParentController<StackLayout> {
|
|
|
421
422
|
if (isEmpty()) return;
|
|
422
423
|
ViewController<?> childController = peek();
|
|
423
424
|
ViewGroup child = childController.getView();
|
|
424
|
-
child
|
|
425
|
+
setChildId(child);
|
|
425
426
|
childController.addOnAppearedListener(this::startChildrenBellowTopChild);
|
|
426
427
|
stackLayout.addView(child, 0, matchParentWithBehaviour(new StackBehaviour(this)));
|
|
427
428
|
presenter.applyInitialChildLayoutOptions(resolveCurrentOptions());
|
|
428
429
|
}
|
|
429
430
|
|
|
431
|
+
private void setChildId(ViewGroup child) {
|
|
432
|
+
//From RN > 64 we can't set id to child that is ReactRootView
|
|
433
|
+
//see:https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java#L676
|
|
434
|
+
if (!(child instanceof ReactRootView))
|
|
435
|
+
child.setId(CompatUtils.generateViewId());
|
|
436
|
+
}
|
|
437
|
+
|
|
430
438
|
private void startChildrenBellowTopChild() {
|
|
431
439
|
ArrayList<ViewController<?>> children = new ArrayList<>(getChildControllers());
|
|
432
440
|
for (int i = children.size() - 2; i >= 0; i--) {
|