react-native-navigation 7.23.1 → 7.24.0-snapshot.465
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/ReactView.java +13 -9
- 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 +169 -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 +43 -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 +20 -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/overlay/OverlayManager.kt +8 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java +11 -5
- 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/bottomtabs/BottomTabs.java +6 -0
- 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/SystemUiUtilsTest.kt +27 -0
- 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 +589 -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 +23 -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 +16 -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/toptabs/TopTabsViewControllerTest.java +2 -0
- 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
|
|
|
@@ -82,6 +84,7 @@ public class ComponentViewController extends ChildController<ComponentLayout> {
|
|
|
82
84
|
|
|
83
85
|
@Override
|
|
84
86
|
public void onViewDisappear() {
|
|
87
|
+
if(lastVisibilityState == VisibilityState.Disappear)return;
|
|
85
88
|
lastVisibilityState = VisibilityState.Disappear;
|
|
86
89
|
if (view != null) view.sendComponentStop();
|
|
87
90
|
super.onViewDisappear();
|
|
@@ -126,8 +129,9 @@ public class ComponentViewController extends ChildController<ComponentLayout> {
|
|
|
126
129
|
|
|
127
130
|
@Override
|
|
128
131
|
public int getTopInset() {
|
|
129
|
-
int statusBarInset = resolveCurrentOptions(presenter.defaultOptions).statusBar.isHiddenOrDrawBehind() ? 0 :
|
|
130
|
-
|
|
132
|
+
int statusBarInset = resolveCurrentOptions(presenter.defaultOptions).statusBar.isHiddenOrDrawBehind() ? 0 : SystemUiUtils.getStatusBarHeight(getActivity());
|
|
133
|
+
final Integer perform = perform(getParentController(), 0, p -> p.getTopInset(this));
|
|
134
|
+
return statusBarInset + perform;
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
@Override
|
|
@@ -136,14 +140,19 @@ public class ComponentViewController extends ChildController<ComponentLayout> {
|
|
|
136
140
|
}
|
|
137
141
|
|
|
138
142
|
@Override
|
|
139
|
-
protected WindowInsetsCompat
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
))
|
|
146
|
-
|
|
143
|
+
protected WindowInsetsCompat onApplyWindowInsets(View view, WindowInsetsCompat insets) {
|
|
144
|
+
ViewController<?> viewController = findController(view);
|
|
145
|
+
if (viewController == null || viewController.getView() == null) return insets;
|
|
146
|
+
final Insets keyboardInsets = insets.getInsets( WindowInsetsCompat.Type.ime());
|
|
147
|
+
final Insets systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars() );
|
|
148
|
+
final int visibleNavBar = resolveCurrentOptions(presenter.defaultOptions).navigationBar.isVisible.isTrueOrUndefined()?1:0;
|
|
149
|
+
final WindowInsetsCompat finalInsets = new WindowInsetsCompat.Builder().setInsets(WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.ime(),
|
|
150
|
+
Insets.of(systemBarsInsets.left,
|
|
151
|
+
0,
|
|
152
|
+
systemBarsInsets.right,
|
|
153
|
+
Math.max(visibleNavBar*systemBarsInsets.bottom,keyboardInsets.bottom))
|
|
154
|
+
).build();
|
|
155
|
+
return ViewCompat.onApplyWindowInsets(viewController.getView(), finalInsets);
|
|
147
156
|
}
|
|
148
157
|
|
|
149
158
|
@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
|
|
|
@@ -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());
|
|
@@ -421,12 +420,19 @@ public class StackController extends ParentController<StackLayout> {
|
|
|
421
420
|
if (isEmpty()) return;
|
|
422
421
|
ViewController<?> childController = peek();
|
|
423
422
|
ViewGroup child = childController.getView();
|
|
424
|
-
child
|
|
423
|
+
setChildId(child);
|
|
425
424
|
childController.addOnAppearedListener(this::startChildrenBellowTopChild);
|
|
426
425
|
stackLayout.addView(child, 0, matchParentWithBehaviour(new StackBehaviour(this)));
|
|
427
426
|
presenter.applyInitialChildLayoutOptions(resolveCurrentOptions());
|
|
428
427
|
}
|
|
429
428
|
|
|
429
|
+
private void setChildId(ViewGroup child) {
|
|
430
|
+
//From RN > 64 we can't set id to child that is ReactRootView
|
|
431
|
+
//see:https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java#L676
|
|
432
|
+
if (!(child instanceof ReactRootView))
|
|
433
|
+
child.setId(CompatUtils.generateViewId());
|
|
434
|
+
}
|
|
435
|
+
|
|
430
436
|
private void startChildrenBellowTopChild() {
|
|
431
437
|
ArrayList<ViewController<?>> children = new ArrayList<>(getChildControllers());
|
|
432
438
|
for (int i = children.size() - 2; i >= 0; i--) {
|