hybrid-navigation 3.1.5 → 4.0.1
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/README.md +4 -4
- package/android/build.gradle +1 -2
- package/android/src/main/java/androidx/fragment/app/InternalFragment.java +22 -0
- package/android/src/main/java/com/navigation/androidx/AppUtils.java +54 -0
- package/android/src/main/java/com/navigation/androidx/AwesomeActivity.java +211 -0
- package/android/src/main/java/com/navigation/androidx/AwesomeFragment.java +685 -0
- package/android/src/main/java/com/navigation/androidx/BarStyle.java +7 -0
- package/android/src/main/java/com/navigation/androidx/DefaultTabBarProvider.java +89 -0
- package/android/src/main/java/com/navigation/androidx/DrawableUtils.java +57 -0
- package/android/src/main/java/com/navigation/androidx/DrawerFragment.java +392 -0
- package/android/src/main/java/com/navigation/androidx/FragmentHelper.java +318 -0
- package/android/src/main/java/com/navigation/androidx/LifecycleDelegate.java +86 -0
- package/android/src/main/java/com/navigation/androidx/PresentableActivity.java +23 -0
- package/android/src/main/java/com/navigation/androidx/PresentationDelegate.java +195 -0
- package/android/src/main/java/com/navigation/androidx/PresentationStyle.java +5 -0
- package/android/src/main/java/com/navigation/androidx/StackDelegate.java +111 -0
- package/android/src/main/java/com/navigation/androidx/StackFragment.java +287 -0
- package/android/src/main/java/com/navigation/androidx/StackLayoutInflater.java +34 -0
- package/android/src/main/java/com/navigation/androidx/Style.java +141 -0
- package/android/src/main/java/com/navigation/androidx/SystemUI.java +240 -0
- package/android/src/main/java/com/navigation/androidx/SystemUI30.java +87 -0
- package/android/src/main/java/com/navigation/androidx/TabBar.java +353 -0
- package/android/src/main/java/com/navigation/androidx/TabBarFragment.java +313 -0
- package/android/src/main/java/com/navigation/androidx/TabBarItem.java +102 -0
- package/android/src/main/java/com/navigation/androidx/TabBarProvider.java +30 -0
- package/android/src/main/java/com/navigation/androidx/TabView.java +226 -0
- package/android/src/main/java/com/navigation/androidx/TransitionAnimation.java +31 -0
- package/android/src/main/java/com/reactnative/hybridnavigation/Garden.java +6 -243
- package/android/src/main/java/com/reactnative/hybridnavigation/GlobalStyle.java +8 -141
- package/android/src/main/java/com/reactnative/hybridnavigation/HBDRootView.java +33 -71
- package/android/src/main/java/com/reactnative/hybridnavigation/HybridFragment.java +12 -61
- package/android/src/main/java/com/reactnative/hybridnavigation/NativeGarden.java +0 -47
- package/android/src/main/java/com/reactnative/hybridnavigation/Parameters.java +3 -3
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactAppCompatActivityDelegate.java +2 -0
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactFragment.java +3 -89
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactManager.java +0 -5
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactStackFragment.java +0 -18
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactSurfaceCleanup.java +54 -0
- package/android/src/main/java/com/reactnative/hybridnavigation/Utils.java +1 -10
- package/android/src/main/res/anim/{nav_push_translucent_enter.xml → nav_delay.xml} +1 -1
- package/android/src/main/res/anim/{nav_pop_translucent_enter.xml → nav_dismiss_enter.xml} +1 -1
- package/android/src/main/res/anim/nav_dismiss_exit.xml +6 -0
- package/android/src/main/res/anim/nav_fade_in.xml +5 -0
- package/android/src/main/res/anim/nav_fade_out.xml +5 -0
- package/android/src/main/res/anim/nav_pop_enter.xml +6 -0
- package/android/src/main/res/anim/nav_pop_exit.xml +6 -0
- package/android/src/main/res/anim/nav_present_enter.xml +6 -0
- package/android/src/main/res/anim/{nav_pop_translucent_exit.xml → nav_present_exit.xml} +1 -1
- package/android/src/main/res/anim/nav_push_enter.xml +6 -0
- package/android/src/main/res/anim/{nav_push_translucent_exit.xml → nav_push_exit.xml} +2 -1
- package/android/src/main/res/drawable/nav_dot_badge_background.xml +5 -0
- package/android/src/main/res/drawable/nav_text_badge_background.xml +5 -0
- package/android/src/main/res/drawable-v21/nav_toolbar_button_item_background.xml +24 -0
- package/android/src/main/res/layout/nav_fragment_drawer.xml +23 -0
- package/android/src/main/res/layout/nav_fragment_navigation.xml +7 -0
- package/android/src/main/res/layout/nav_fragment_tabbar.xml +13 -0
- package/android/src/main/res/layout/nav_tab_bar_container.xml +15 -0
- package/android/src/main/res/layout/nav_tab_bar_item.xml +49 -0
- package/android/src/main/res/values/dimens.xml +11 -0
- package/android/src/main/res/values/strings.xml +1 -0
- package/dist/NativeEvent.d.ts +0 -5
- package/dist/NativeGarden.d.ts +0 -5
- package/dist/Navigation.d.ts +1 -11
- package/dist/Navigation.js +1 -31
- package/dist/Navigator.js +0 -4
- package/dist/Options.d.ts +2 -70
- package/dist/Options.js +0 -4
- package/ios/GlobalStyle.h +1 -9
- package/ios/GlobalStyle.mm +48 -310
- package/ios/HBDUtils.h +0 -14
- package/ios/HBDUtils.mm +1 -116
- package/ios/HybridNavigation.h +0 -3
- package/ios/Navigator/HBDScreenNavigator.mm +12 -4
- package/ios/Navigator/HBDStackNavigator.mm +36 -39
- package/ios/React/HBDNativeGarden.mm +0 -40
- package/ios/React/HBDNativeNavigation.mm +21 -16
- package/ios/View/HBDRootView.h +0 -2
- package/ios/View/HBDRootView.mm +0 -21
- package/ios/ViewController/HBDDrawerController.mm +3 -11
- package/ios/ViewController/HBDFadeAnimation.mm +10 -26
- package/ios/ViewController/HBDNavigationController.h +0 -6
- package/ios/ViewController/HBDNavigationController.mm +42 -661
- package/ios/ViewController/HBDReactViewController.mm +7 -101
- package/ios/ViewController/HBDTabBarController.mm +10 -6
- package/ios/ViewController/HBDViewController.mm +58 -182
- package/ios/ViewController/UINavigationController+HBD.mm +0 -3
- package/ios/ViewController/UIViewController+HBD.h +0 -9
- package/ios/ViewController/UIViewController+HBD.mm +1 -131
- package/package.json +1 -1
- package/src/NativeEvent.ts +0 -6
- package/src/NativeGarden.ts +0 -11
- package/src/Navigation.ts +2 -68
- package/src/Navigator.ts +0 -5
- package/src/Options.ts +2 -76
- package/dist/handler/BarButtonEventHandler.d.ts +0 -10
- package/dist/handler/BarButtonEventHandler.js +0 -38
- package/ios/View/HBDBackBarButtonItem.h +0 -9
- package/ios/View/HBDBackBarButtonItem.mm +0 -13
- package/ios/View/HBDBarButtonItem.h +0 -24
- package/ios/View/HBDBarButtonItem.mm +0 -69
- package/ios/View/HBDNavigationBar.h +0 -15
- package/ios/View/HBDNavigationBar.mm +0 -207
- package/ios/View/HBDTitleView.h +0 -7
- package/ios/View/HBDTitleView.mm +0 -66
- package/ios/ViewController/HBDPopAnimation.h +0 -9
- package/ios/ViewController/HBDPopAnimation.mm +0 -27
- package/ios/ViewController/HBDPushAnimation.h +0 -9
- package/ios/ViewController/HBDPushAnimation.mm +0 -28
- package/ios/ViewController/HBDViewController+Garden.h +0 -17
- package/ios/ViewController/HBDViewController+Garden.mm +0 -183
- package/src/handler/BarButtonEventHandler.ts +0 -50
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Copyright (C) 2015 The Android Open Source Project
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
|
18
|
+
android:color="?attr/colorControlHighlight">
|
|
19
|
+
<item android:id="@android:id/mask">
|
|
20
|
+
<shape android:shape="ring" android:innerRadius="0dp" android:thickness="20dp">
|
|
21
|
+
<solid android:color="#ffffff"/>
|
|
22
|
+
</shape>
|
|
23
|
+
</item>
|
|
24
|
+
</ripple>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
android:id="@+id/drawer"
|
|
4
|
+
android:fitsSystemWindows="false"
|
|
5
|
+
android:layout_width="match_parent"
|
|
6
|
+
android:layout_height="match_parent">
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<FrameLayout
|
|
10
|
+
android:fitsSystemWindows="false"
|
|
11
|
+
android:id="@+id/drawer_content"
|
|
12
|
+
android:layout_width="match_parent"
|
|
13
|
+
android:layout_height="match_parent" />
|
|
14
|
+
|
|
15
|
+
<FrameLayout
|
|
16
|
+
android:fitsSystemWindows="false"
|
|
17
|
+
android:id="@+id/drawer_menu"
|
|
18
|
+
android:layout_width="match_parent"
|
|
19
|
+
android:layout_height="match_parent"
|
|
20
|
+
android:layout_gravity="start" />
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
</androidx.drawerlayout.widget.DrawerLayout>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
android:layout_width="match_parent"
|
|
4
|
+
android:layout_height="match_parent"
|
|
5
|
+
>
|
|
6
|
+
|
|
7
|
+
<FrameLayout
|
|
8
|
+
android:id="@+id/tabs_content"
|
|
9
|
+
android:layout_width="match_parent"
|
|
10
|
+
android:layout_height="match_parent"
|
|
11
|
+
/>
|
|
12
|
+
|
|
13
|
+
</FrameLayout>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
android:id="@+id/nav_tab_bar_container"
|
|
4
|
+
android:layout_width="match_parent"
|
|
5
|
+
android:layout_height="@dimen/nav_tab_bar_height"
|
|
6
|
+
android:layout_gravity="bottom">
|
|
7
|
+
|
|
8
|
+
<LinearLayout
|
|
9
|
+
android:id="@+id/nav_tab_bar_item_container"
|
|
10
|
+
android:layout_width="match_parent"
|
|
11
|
+
android:layout_height="match_parent"
|
|
12
|
+
android:gravity="center"
|
|
13
|
+
android:orientation="horizontal" />
|
|
14
|
+
|
|
15
|
+
</FrameLayout>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
android:id="@+id/nav_tab_item_container"
|
|
4
|
+
android:layout_width="match_parent"
|
|
5
|
+
android:layout_height="@dimen/nav_tab_bar_height"
|
|
6
|
+
android:focusable="true"
|
|
7
|
+
android:orientation="vertical"
|
|
8
|
+
android:paddingLeft="@dimen/nav_tab_item_width_padding"
|
|
9
|
+
android:paddingRight="@dimen/nav_tab_item_width_padding">
|
|
10
|
+
|
|
11
|
+
<FrameLayout
|
|
12
|
+
android:id="@+id/nav_tab_item_icon_container"
|
|
13
|
+
android:layout_width="@dimen/nav_tab_icon_badge_grid_width"
|
|
14
|
+
android:layout_height="@dimen/nav_tab_icon_badge_grid_height"
|
|
15
|
+
android:layout_gravity="center_horizontal|top">
|
|
16
|
+
|
|
17
|
+
<ImageView
|
|
18
|
+
android:id="@+id/nav_tab_item_icon"
|
|
19
|
+
android:layout_width="@dimen/nav_tab_item_icon_grid"
|
|
20
|
+
android:layout_height="@dimen/nav_tab_item_icon_grid"
|
|
21
|
+
android:layout_gravity="center"
|
|
22
|
+
android:layout_marginTop="@dimen/nav_tab_item_icon_grid_margin_top"
|
|
23
|
+
android:contentDescription="@string/icon"
|
|
24
|
+
android:gravity="center"
|
|
25
|
+
android:scaleType="centerInside" />
|
|
26
|
+
|
|
27
|
+
<TextView
|
|
28
|
+
android:id="@+id/nav_tab_item_badge"
|
|
29
|
+
android:layout_width="wrap_content"
|
|
30
|
+
android:layout_height="wrap_content"
|
|
31
|
+
android:layout_gravity="top|end"
|
|
32
|
+
android:gravity="center"
|
|
33
|
+
android:paddingLeft="6dp"
|
|
34
|
+
android:paddingRight="6dp"
|
|
35
|
+
android:textColor="@android:color/white"
|
|
36
|
+
/>
|
|
37
|
+
</FrameLayout>
|
|
38
|
+
|
|
39
|
+
<TextView
|
|
40
|
+
android:id="@+id/nav_tab_item_title"
|
|
41
|
+
android:layout_width="match_parent"
|
|
42
|
+
android:layout_height="wrap_content"
|
|
43
|
+
android:layout_gravity="center_horizontal|bottom"
|
|
44
|
+
android:gravity="center"
|
|
45
|
+
android:includeFontPadding="false"
|
|
46
|
+
android:lines="1"
|
|
47
|
+
android:textSize="@dimen/nav_tab_item_title_size" />
|
|
48
|
+
|
|
49
|
+
</LinearLayout>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<resources>
|
|
3
|
+
<dimen name="nav_tab_item_min_width">120dp</dimen>
|
|
4
|
+
<dimen name="nav_tab_item_width_padding">12dp</dimen>
|
|
5
|
+
<dimen name="nav_tab_item_title_size">12dp</dimen>
|
|
6
|
+
<dimen name="nav_tab_item_icon_grid">24dp</dimen>
|
|
7
|
+
<dimen name="nav_tab_item_icon_grid_margin_top">2dp</dimen>
|
|
8
|
+
<dimen name="nav_tab_icon_badge_grid_height">36dp</dimen>
|
|
9
|
+
<dimen name="nav_tab_icon_badge_grid_width">52dp</dimen>
|
|
10
|
+
<dimen name="nav_tab_bar_height">56dp</dimen>
|
|
11
|
+
</resources>
|
package/dist/NativeEvent.d.ts
CHANGED
|
@@ -5,10 +5,6 @@ export type ComponentAppearEvent = {
|
|
|
5
5
|
export type ComponentDisappearEvent = {
|
|
6
6
|
sceneId: string;
|
|
7
7
|
};
|
|
8
|
-
export type BarButtonItemClickEvent = {
|
|
9
|
-
sceneId: string;
|
|
10
|
-
action: string;
|
|
11
|
-
};
|
|
12
8
|
export type ResultEvent = {
|
|
13
9
|
sceneId: string;
|
|
14
10
|
requestCode: number;
|
|
@@ -25,7 +21,6 @@ export interface Spec extends TurboModule {
|
|
|
25
21
|
readonly willSetRoot: CodegenTypes.EventEmitter<void>;
|
|
26
22
|
readonly didSetRoot: CodegenTypes.EventEmitter<void>;
|
|
27
23
|
readonly onSwitchTab: CodegenTypes.EventEmitter<SwitchTabEvent>;
|
|
28
|
-
readonly onBarButtonItemClick: CodegenTypes.EventEmitter<BarButtonItemClickEvent>;
|
|
29
24
|
readonly onComponentAppear: CodegenTypes.EventEmitter<ComponentAppearEvent>;
|
|
30
25
|
readonly onComponentDisappear: CodegenTypes.EventEmitter<ComponentDisappearEvent>;
|
|
31
26
|
}
|
package/dist/NativeGarden.d.ts
CHANGED
|
@@ -4,11 +4,6 @@ export interface Spec extends TurboModule {
|
|
|
4
4
|
TOOLBAR_HEIGHT: number;
|
|
5
5
|
};
|
|
6
6
|
setStyle: (style: CodegenTypes.UnsafeObject) => void;
|
|
7
|
-
setTitleItem: (sceneId: string, item: CodegenTypes.UnsafeObject) => void;
|
|
8
|
-
setLeftBarButtonItem: (sceneId: string, item: CodegenTypes.UnsafeObject | null) => void;
|
|
9
|
-
setRightBarButtonItem: (sceneId: string, item: CodegenTypes.UnsafeObject | null) => void;
|
|
10
|
-
setLeftBarButtonItems: (sceneId: string, items: Array<CodegenTypes.UnsafeObject> | null) => void;
|
|
11
|
-
setRightBarButtonItems: (sceneId: string, items: Array<CodegenTypes.UnsafeObject> | null) => void;
|
|
12
7
|
updateOptions: (sceneId: string, options: CodegenTypes.UnsafeObject) => void;
|
|
13
8
|
updateTabBar: (sceneId: string, item: CodegenTypes.UnsafeObject) => void;
|
|
14
9
|
setTabItem: (sceneId: string, item: Array<CodegenTypes.UnsafeObject>) => void;
|
package/dist/Navigation.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { ComponentProvider } from 'react-native';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DefaultOptions, NavigationOption, TabBarStyle, TabItemInfo } from './Options';
|
|
4
4
|
import type { BuildInLayout, Layout, Route, RouteGraph, RouteConfig } from './Route';
|
|
5
5
|
import { ResultType } from './handler/ResultEventHandler';
|
|
6
6
|
import { GlobalVisibilityEventListener, VisibilityEventListener } from './handler/VisibilityEventHandler';
|
|
7
7
|
export type { ResultType } from './handler/ResultEventHandler';
|
|
8
8
|
import type { DispatchParams, NavigationInterceptor } from './handler/DispatchCommandHandler';
|
|
9
9
|
export type { DispatchParams, NavigationInterceptor } from './handler/DispatchCommandHandler';
|
|
10
|
-
type BarButtonClickEventListener = (sceneId: string, value: Function) => void;
|
|
11
|
-
type Nullable<T> = {
|
|
12
|
-
[P in keyof T]: T[P] extends T[P] | undefined ? T[P] | null : T[P];
|
|
13
|
-
};
|
|
14
10
|
export declare const RESULT_CANCEL: number, RESULT_OK: number, RESULT_BLOCK: number;
|
|
15
11
|
export type NavigationSubscription = {
|
|
16
12
|
remove: () => void;
|
|
@@ -38,16 +34,10 @@ export interface Navigation {
|
|
|
38
34
|
currentRoute(): Promise<Route>;
|
|
39
35
|
routeGraph(): Promise<RouteGraph[]>;
|
|
40
36
|
setDefaultOptions(options: DefaultOptions): void;
|
|
41
|
-
setLeftBarButtonItem(sceneId: string, buttonItem: Nullable<BarButtonItem> | null): void;
|
|
42
|
-
setRightBarButtonItem(sceneId: string, buttonItem: Nullable<BarButtonItem> | null): void;
|
|
43
|
-
setLeftBarButtonItems(sceneId: string, buttonItems: Array<Nullable<BarButtonItem>> | null): void;
|
|
44
|
-
setRightBarButtonItems(sceneId: string, buttonItems: Array<Nullable<BarButtonItem>> | null): void;
|
|
45
|
-
setTitleItem(sceneId: string, titleItem: TitleItem): void;
|
|
46
37
|
updateOptions(sceneId: string, options: NavigationOption): void;
|
|
47
38
|
updateTabBar(sceneId: string, options: TabBarStyle): void;
|
|
48
39
|
setTabItem(sceneId: string, item: TabItemInfo | TabItemInfo[]): void;
|
|
49
40
|
setMenuInteractive(sceneId: string, enabled: boolean): void;
|
|
50
|
-
setBarButtonClickEventListener(listener: BarButtonClickEventListener): void;
|
|
51
41
|
}
|
|
52
42
|
declare const _default: Navigation;
|
|
53
43
|
export default _default;
|
package/dist/Navigation.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AppRegistry } from 'react-native';
|
|
2
|
-
import BarButtonEventHandler from './handler/BarButtonEventHandler';
|
|
3
2
|
import LayoutCommandHandler from './handler/LayoutCommandHandler';
|
|
4
3
|
import DispatchCommandHandler from './handler/DispatchCommandHandler';
|
|
5
4
|
import ResultEventHandler from './handler/ResultEventHandler';
|
|
@@ -11,7 +10,6 @@ export const { RESULT_CANCEL, RESULT_OK, RESULT_BLOCK } = NativeNavigation.getCo
|
|
|
11
10
|
class NavigationImpl {
|
|
12
11
|
dispatchHandler = new DispatchCommandHandler();
|
|
13
12
|
resultHandler = new ResultEventHandler();
|
|
14
|
-
buttonHandler = new BarButtonEventHandler();
|
|
15
13
|
layoutHandler = new LayoutCommandHandler();
|
|
16
14
|
visibilityHandler = new VisibilityEventHandler();
|
|
17
15
|
constructor() {
|
|
@@ -44,9 +42,7 @@ class NavigationImpl {
|
|
|
44
42
|
if (this.hoc) {
|
|
45
43
|
WrappedComponent = this.hoc(WrappedComponent);
|
|
46
44
|
}
|
|
47
|
-
|
|
48
|
-
let options = this.bindBarButtonClickEvent('permanent', WrappedComponent.navigationItem) ||
|
|
49
|
-
{};
|
|
45
|
+
const options = WrappedComponent.navigationItem || {};
|
|
50
46
|
NativeNavigation.registerReactComponent(appKey, options);
|
|
51
47
|
let RootComponent = this.wrap(appKey)(WrappedComponent);
|
|
52
48
|
AppRegistry.registerComponent(appKey, () => RootComponent);
|
|
@@ -95,7 +91,6 @@ class NavigationImpl {
|
|
|
95
91
|
}
|
|
96
92
|
unmount(sceneId) {
|
|
97
93
|
this.resultHandler.invalidateResultEventListener(sceneId);
|
|
98
|
-
this.buttonHandler.unbindBarButtonClickEvent(sceneId);
|
|
99
94
|
}
|
|
100
95
|
setRoot(layout, sticky = false) {
|
|
101
96
|
return this.layoutHandler.setRoot(layout, sticky);
|
|
@@ -144,25 +139,6 @@ class NavigationImpl {
|
|
|
144
139
|
setDefaultOptions(options) {
|
|
145
140
|
NativeGarden.setStyle(options);
|
|
146
141
|
}
|
|
147
|
-
setLeftBarButtonItem(sceneId, buttonItem) {
|
|
148
|
-
const options = this.bindBarButtonClickEvent(sceneId, buttonItem);
|
|
149
|
-
NativeGarden.setLeftBarButtonItem(sceneId, options);
|
|
150
|
-
}
|
|
151
|
-
setRightBarButtonItem(sceneId, buttonItem) {
|
|
152
|
-
const options = this.bindBarButtonClickEvent(sceneId, buttonItem);
|
|
153
|
-
NativeGarden.setRightBarButtonItem(sceneId, options);
|
|
154
|
-
}
|
|
155
|
-
setLeftBarButtonItems(sceneId, buttonItems) {
|
|
156
|
-
const options = this.bindBarButtonClickEvent(sceneId, buttonItems);
|
|
157
|
-
NativeGarden.setLeftBarButtonItems(sceneId, options);
|
|
158
|
-
}
|
|
159
|
-
setRightBarButtonItems(sceneId, buttonItems) {
|
|
160
|
-
const options = this.bindBarButtonClickEvent(sceneId, buttonItems);
|
|
161
|
-
NativeGarden.setRightBarButtonItems(sceneId, options);
|
|
162
|
-
}
|
|
163
|
-
setTitleItem(sceneId, titleItem) {
|
|
164
|
-
NativeGarden.setTitleItem(sceneId, titleItem);
|
|
165
|
-
}
|
|
166
142
|
updateOptions(sceneId, options) {
|
|
167
143
|
NativeGarden.updateOptions(sceneId, options);
|
|
168
144
|
}
|
|
@@ -178,11 +154,5 @@ class NavigationImpl {
|
|
|
178
154
|
setMenuInteractive(sceneId, enabled) {
|
|
179
155
|
NativeGarden.setMenuInteractive(sceneId, enabled);
|
|
180
156
|
}
|
|
181
|
-
setBarButtonClickEventListener(listener) {
|
|
182
|
-
this.buttonHandler.setBarButtonClickEventListener(listener);
|
|
183
|
-
}
|
|
184
|
-
bindBarButtonClickEvent(sceneId, item) {
|
|
185
|
-
return this.buttonHandler.bindBarButtonClickEvent(sceneId, item);
|
|
186
|
-
}
|
|
187
157
|
}
|
|
188
158
|
export default new NavigationImpl();
|
package/dist/Navigator.js
CHANGED
|
@@ -9,10 +9,6 @@ Navigation.addGlobalVisibilityEventListener((sceneId, visibility) => {
|
|
|
9
9
|
navigator.visibility = visibility;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Navigation.setBarButtonClickEventListener((sceneId, value) => {
|
|
13
|
-
const navigator = Navigator.of(sceneId);
|
|
14
|
-
value(navigator);
|
|
15
|
-
});
|
|
16
12
|
export class Navigator {
|
|
17
13
|
sceneId;
|
|
18
14
|
moduleName;
|
package/dist/Options.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Navigator } from './Navigator';
|
|
2
1
|
export type Color = string;
|
|
3
2
|
export type ImageSource = {
|
|
4
3
|
uri: string;
|
|
@@ -11,71 +10,25 @@ export type BarStyleLightContent = typeof BarStyleLightContent;
|
|
|
11
10
|
export declare const BarStyleDarkContent = "dark-content";
|
|
12
11
|
export type BarStyleDarkContent = typeof BarStyleDarkContent;
|
|
13
12
|
export type BarStyle = BarStyleLightContent | BarStyleDarkContent;
|
|
14
|
-
export declare const TitleAlignmentLeft = "left";
|
|
15
|
-
export type TitleAlignmentLeft = typeof TitleAlignmentLeft;
|
|
16
|
-
export declare const TitleAlignmentCenter = "center";
|
|
17
|
-
export type TitleAlignmentCenter = typeof TitleAlignmentCenter;
|
|
18
|
-
export type TitleAlignment = TitleAlignmentCenter | TitleAlignmentLeft;
|
|
19
|
-
export declare const LayoutFittingExpanded = "expanded";
|
|
20
|
-
export type LayoutFittingExpanded = typeof LayoutFittingExpanded;
|
|
21
|
-
export declare const LayoutFittingCompressed = "compressed";
|
|
22
|
-
export type LayoutFittingCompressed = typeof LayoutFittingCompressed;
|
|
23
|
-
export type LayoutFitting = LayoutFittingExpanded | LayoutFittingCompressed;
|
|
24
13
|
export interface NavigationOption {
|
|
25
14
|
screenBackgroundColor?: Color;
|
|
26
15
|
statusBarHidden?: boolean;
|
|
27
|
-
|
|
28
|
-
topBarColor?: Color;
|
|
29
|
-
topBarShadowHidden?: boolean;
|
|
30
|
-
topBarAlpha?: number;
|
|
31
|
-
topBarTintColor?: Color;
|
|
32
|
-
titleTextColor?: Color;
|
|
33
|
-
titleTextSize?: number;
|
|
16
|
+
statusBarStyle?: BarStyle;
|
|
34
17
|
navigationBarColorAndroid?: Color;
|
|
35
18
|
navigationBarHiddenAndroid?: boolean;
|
|
36
|
-
fitsOpaqueNavigationBarAndroid?: boolean;
|
|
37
19
|
displayCutoutWhenLandscapeAndroid?: boolean;
|
|
38
20
|
homeIndicatorAutoHiddenIOS?: boolean;
|
|
39
|
-
backButtonHidden?: boolean;
|
|
40
21
|
backInteractive?: boolean;
|
|
41
22
|
}
|
|
42
23
|
export interface NavigationItem extends NavigationOption {
|
|
43
|
-
passThroughTouches?: boolean;
|
|
44
|
-
forceTransparentDialogWindow?: boolean;
|
|
45
24
|
animatedTransition?: boolean;
|
|
46
25
|
forceScreenLandscape?: boolean;
|
|
47
|
-
topBarHidden?: boolean;
|
|
48
|
-
extendedLayoutIncludesTopBar?: boolean;
|
|
49
|
-
swipeBackEnabled?: boolean;
|
|
50
|
-
titleItem?: TitleItem;
|
|
51
|
-
leftBarButtonItem?: BarButtonItem;
|
|
52
|
-
rightBarButtonItem?: BarButtonItem;
|
|
53
|
-
leftBarButtonItems?: BarButtonItem[];
|
|
54
|
-
rightBarButtonItems?: BarButtonItem[];
|
|
55
26
|
tabItem?: TabItem;
|
|
56
27
|
}
|
|
57
|
-
export interface BarButtonItem {
|
|
58
|
-
title?: string;
|
|
59
|
-
icon?: ImageSource;
|
|
60
|
-
action?: (navigator: Navigator) => void;
|
|
61
|
-
enabled?: boolean;
|
|
62
|
-
tintColor?: Color;
|
|
63
|
-
renderOriginal?: boolean;
|
|
64
|
-
}
|
|
65
|
-
export interface TitleItem {
|
|
66
|
-
title?: string;
|
|
67
|
-
moduleName?: string;
|
|
68
|
-
layoutFitting?: LayoutFitting;
|
|
69
|
-
}
|
|
70
|
-
export interface BackItem {
|
|
71
|
-
title: string;
|
|
72
|
-
tintColor?: Color;
|
|
73
|
-
}
|
|
74
28
|
export interface TabItem {
|
|
75
29
|
title: string;
|
|
76
30
|
icon?: ImageSource;
|
|
77
31
|
unselectedIcon?: ImageSource;
|
|
78
|
-
hideTabBarWhenPush?: boolean;
|
|
79
32
|
}
|
|
80
33
|
export interface ShadowImage {
|
|
81
34
|
image?: ImageSource;
|
|
@@ -83,35 +36,14 @@ export interface ShadowImage {
|
|
|
83
36
|
}
|
|
84
37
|
export interface DefaultOptions {
|
|
85
38
|
screenBackgroundColor?: Color;
|
|
86
|
-
|
|
87
|
-
topBarColor?: Color;
|
|
88
|
-
topBarColorDarkContent?: Color;
|
|
89
|
-
topBarColorLightContent?: Color;
|
|
39
|
+
statusBarStyle?: BarStyle;
|
|
90
40
|
navigationBarColorAndroid?: Color;
|
|
91
|
-
hideBackTitleIOS?: boolean;
|
|
92
|
-
elevationAndroid?: number;
|
|
93
|
-
shadowImage?: ShadowImage;
|
|
94
|
-
backIcon?: ImageSource;
|
|
95
|
-
topBarTintColor?: Color;
|
|
96
|
-
topBarTintColorDarkContent?: Color;
|
|
97
|
-
topBarTintColorLightContent?: Color;
|
|
98
|
-
titleTextColor?: Color;
|
|
99
|
-
titleTextColorDarkContent?: Color;
|
|
100
|
-
titleTextColorLightContent?: Color;
|
|
101
|
-
titleTextSize?: number;
|
|
102
|
-
titleAlignmentAndroid?: TitleAlignment;
|
|
103
|
-
barButtonItemTextSize?: number;
|
|
104
|
-
swipeBackEnabledAndroid?: boolean;
|
|
105
|
-
splitTopBarTransitionIOS?: boolean;
|
|
106
|
-
scrimAlphaAndroid?: number;
|
|
107
|
-
fitsOpaqueNavigationBarAndroid?: boolean;
|
|
108
41
|
displayCutoutWhenLandscapeAndroid?: boolean;
|
|
109
42
|
tabBarBackgroundColor?: Color;
|
|
110
43
|
tabBarShadowImage?: ShadowImage;
|
|
111
44
|
tabBarItemSelectedColor?: Color;
|
|
112
45
|
tabBarItemNormalColor?: Color;
|
|
113
46
|
tabBarBadgeColor?: Color;
|
|
114
|
-
topBarHidden?: boolean;
|
|
115
47
|
}
|
|
116
48
|
export type TabBarStyle = Pick<DefaultOptions, 'tabBarBackgroundColor' | 'tabBarShadowImage' | 'tabBarItemSelectedColor' | 'tabBarItemNormalColor'>;
|
|
117
49
|
export interface TabItemInfo {
|
package/dist/Options.js
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
export const BarStyleLightContent = 'light-content';
|
|
2
2
|
export const BarStyleDarkContent = 'dark-content';
|
|
3
|
-
export const TitleAlignmentLeft = 'left';
|
|
4
|
-
export const TitleAlignmentCenter = 'center';
|
|
5
|
-
export const LayoutFittingExpanded = 'expanded';
|
|
6
|
-
export const LayoutFittingCompressed = 'compressed';
|
package/ios/GlobalStyle.h
CHANGED
|
@@ -7,17 +7,9 @@
|
|
|
7
7
|
+ (GlobalStyle *)globalStyle;
|
|
8
8
|
|
|
9
9
|
@property(nonatomic, strong, readonly) UIColor *screenBackgroundColor;
|
|
10
|
-
@property(nonatomic, assign, readonly
|
|
11
|
-
@property(nonatomic, assign, readonly, getter=isTopBarHidden) BOOL topBarHidden;
|
|
12
|
-
@property(nonatomic, assign, readonly) BOOL alwaysSplitNavigationBarTransition;
|
|
10
|
+
@property(nonatomic, assign, readonly) UIBarStyle statusBarStyle;
|
|
13
11
|
@property(nonatomic, assign) UIInterfaceOrientationMask interfaceOrientation;
|
|
14
12
|
|
|
15
13
|
- (instancetype)initWithOptions:(NSDictionary *)options;
|
|
16
14
|
|
|
17
|
-
- (UIColor *)titleTextColorWithBarStyle:(UIBarStyle)barStyle;
|
|
18
|
-
|
|
19
|
-
- (UIColor *)tintColorWithBarStyle:(UIBarStyle)barStyle;
|
|
20
|
-
|
|
21
|
-
- (UIColor *)barTintColorWithBarStyle:(UIBarStyle)barStyle;
|
|
22
|
-
|
|
23
15
|
@end
|