expo-navigation-bar 4.1.2 → 4.2.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/CHANGELOG.md +10 -0
- package/android/build.gradle +2 -2
- package/build/NativeNavigationBarWrapper.d.ts +178 -0
- package/build/NativeNavigationBarWrapper.d.ts.map +1 -0
- package/build/NativeNavigationBarWrapper.js +316 -0
- package/build/NativeNavigationBarWrapper.js.map +1 -0
- package/build/NavigationBar.d.ts +12 -152
- package/build/NavigationBar.d.ts.map +1 -1
- package/build/NavigationBar.js +32 -292
- package/build/NavigationBar.js.map +1 -1
- package/build/NavigationBar.types.d.ts +9 -0
- package/build/NavigationBar.types.d.ts.map +1 -1
- package/build/NavigationBar.types.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2.module → 4.2.0/expo.modules.navigationbar-4.2.0.module} +7 -7
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2.pom → 4.2.0/expo.modules.navigationbar-4.2.0.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.sha512 +1 -1
- package/package.json +6 -5
- package/src/NativeNavigationBarWrapper.ts +366 -0
- package/src/NavigationBar.ts +39 -320
- package/src/NavigationBar.types.ts +10 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.1.2/expo.modules.navigationbar-4.1.2.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.1.2/expo.modules.navigationbar-4.1.2.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.1.2/expo.modules.navigationbar-4.1.2.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.1.2/expo.modules.navigationbar-4.1.2.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.1.2/expo.modules.navigationbar-4.1.2.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.1.2/expo.modules.navigationbar-4.1.2.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.1.2/expo.modules.navigationbar-4.1.2.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.1.2/expo.modules.navigationbar-4.1.2.pom.sha512 +0 -1
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2-sources.jar → 4.2.0/expo.modules.navigationbar-4.2.0-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2-sources.jar.md5 → 4.2.0/expo.modules.navigationbar-4.2.0-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2-sources.jar.sha1 → 4.2.0/expo.modules.navigationbar-4.2.0-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2-sources.jar.sha256 → 4.2.0/expo.modules.navigationbar-4.2.0-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2-sources.jar.sha512 → 4.2.0/expo.modules.navigationbar-4.2.0-sources.jar.sha512} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2.aar → 4.2.0/expo.modules.navigationbar-4.2.0.aar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2.aar.md5 → 4.2.0/expo.modules.navigationbar-4.2.0.aar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2.aar.sha1 → 4.2.0/expo.modules.navigationbar-4.2.0.aar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2.aar.sha256 → 4.2.0/expo.modules.navigationbar-4.2.0.aar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.1.2/expo.modules.navigationbar-4.1.2.aar.sha512 → 4.2.0/expo.modules.navigationbar-4.2.0.aar.sha512} +0 -0
package/build/NavigationBar.d.ts
CHANGED
|
@@ -1,57 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NavigationBarButtonStyle, NavigationBarBehavior, NavigationBarPosition, NavigationBarVisibility, NavigationBarVisibilityEvent } from './NavigationBar.types';
|
|
1
|
+
import { NavigationBarStyle, NavigationBarVisibility } from './NavigationBar.types';
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Sets the style of the navigation bar.
|
|
4
|
+
* > This will have an effect when the following conditions are met:
|
|
5
|
+
* > - Edge-to-edge is enabled
|
|
6
|
+
* > - The `enforceNavigationBarContrast` option of the `react-native-edge-to-edge` plugin is set to `false`.
|
|
7
|
+
* > - The device is using the three-button navigation bar.
|
|
6
8
|
*
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* NavigationBar.addVisibilityListener(({ visibility }) => {
|
|
10
|
-
* // ...
|
|
11
|
-
* });
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export declare function addVisibilityListener(listener: (event: NavigationBarVisibilityEvent) => void): EventSubscription;
|
|
15
|
-
/**
|
|
16
|
-
* Changes the navigation bar's background color.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* NavigationBar.setBackgroundColorAsync("white");
|
|
21
|
-
* ```
|
|
22
|
-
* @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color).
|
|
23
|
-
*/
|
|
24
|
-
export declare function setBackgroundColorAsync(color: string): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Gets the navigation bar's background color.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const color = await NavigationBar.getBackgroundColorAsync();
|
|
31
|
-
* ```
|
|
32
|
-
* @returns Current navigation bar color in hex format. Returns `#00000000` (transparent) on unsupported platforms (iOS, web).
|
|
33
|
-
*/
|
|
34
|
-
export declare function getBackgroundColorAsync(): Promise<string>;
|
|
35
|
-
/**
|
|
36
|
-
* Changes the navigation bar's border color.
|
|
9
|
+
* > Due to a bug in the Android 15 emulator this function may have no effect. Try a physical device or an emulator with a different version of Android.
|
|
37
10
|
*
|
|
38
|
-
* @
|
|
39
|
-
* ```ts
|
|
40
|
-
* NavigationBar.setBorderColorAsync("red");
|
|
41
|
-
* ```
|
|
42
|
-
* @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color).
|
|
11
|
+
* @platform android
|
|
43
12
|
*/
|
|
44
|
-
export declare function
|
|
45
|
-
/**
|
|
46
|
-
* Gets the navigation bar's top border color, also known as the "divider color".
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```ts
|
|
50
|
-
* const color = await NavigationBar.getBorderColorAsync();
|
|
51
|
-
* ```
|
|
52
|
-
* @returns Navigation bar top border color in hex format. Returns `#00000000` (transparent) on unsupported platforms (iOS, web).
|
|
53
|
-
*/
|
|
54
|
-
export declare function getBorderColorAsync(): Promise<string>;
|
|
13
|
+
export declare function setStyle(style: NavigationBarStyle): void;
|
|
55
14
|
/**
|
|
56
15
|
* Set the navigation bar's visibility.
|
|
57
16
|
*
|
|
@@ -60,108 +19,9 @@ export declare function getBorderColorAsync(): Promise<string>;
|
|
|
60
19
|
* NavigationBar.setVisibilityAsync("hidden");
|
|
61
20
|
* ```
|
|
62
21
|
* @param visibility Based on CSS visibility property.
|
|
22
|
+
* @platform android
|
|
63
23
|
*/
|
|
64
|
-
export declare function setVisibilityAsync(visibility: NavigationBarVisibility): Promise<
|
|
65
|
-
|
|
66
|
-
* Get the navigation bar's visibility.
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```ts
|
|
70
|
-
* const visibility = await NavigationBar.getVisibilityAsync("hidden");
|
|
71
|
-
* ```
|
|
72
|
-
* @returns Navigation bar's current visibility status. Returns `hidden` on unsupported platforms (iOS, web).
|
|
73
|
-
*/
|
|
74
|
-
export declare function getVisibilityAsync(): Promise<NavigationBarVisibility>;
|
|
75
|
-
/**
|
|
76
|
-
* Changes the navigation bar's button colors between white (`light`) and a dark gray color (`dark`).
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```ts
|
|
80
|
-
* NavigationBar.setButtonStyleAsync("light");
|
|
81
|
-
* ```
|
|
82
|
-
* @param style Dictates the color of the foreground element color.
|
|
83
|
-
*/
|
|
84
|
-
export declare function setButtonStyleAsync(style: NavigationBarButtonStyle): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* Gets the navigation bar's button color styles.
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```ts
|
|
90
|
-
* const style = await NavigationBar.getButtonStyleAsync();
|
|
91
|
-
* ```
|
|
92
|
-
* @returns Navigation bar foreground element color settings. Returns `light` on unsupported platforms (iOS, web).
|
|
93
|
-
*/
|
|
94
|
-
export declare function getButtonStyleAsync(): Promise<NavigationBarButtonStyle>;
|
|
95
|
-
/**
|
|
96
|
-
* Sets positioning method used for the navigation bar (and status bar).
|
|
97
|
-
* Setting position `absolute` will float the navigation bar above the content,
|
|
98
|
-
* whereas position `relative` will shrink the screen to inline the navigation bar.
|
|
99
|
-
*
|
|
100
|
-
* When drawing behind the status and navigation bars, ensure the safe area insets are adjusted accordingly.
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* ```ts
|
|
104
|
-
* // enables edge-to-edge mode
|
|
105
|
-
* await NavigationBar.setPositionAsync('absolute')
|
|
106
|
-
* // transparent backgrounds to see through
|
|
107
|
-
* await NavigationBar.setBackgroundColorAsync('#ffffff00')
|
|
108
|
-
* ```
|
|
109
|
-
* @param position Based on CSS position property.
|
|
110
|
-
*/
|
|
111
|
-
export declare function setPositionAsync(position: NavigationBarPosition): Promise<void>;
|
|
112
|
-
/**
|
|
113
|
-
* Whether the navigation and status bars float above the app (absolute) or sit inline with it (relative).
|
|
114
|
-
* This value can be incorrect if `androidNavigationBar.visible` is used instead of the config plugin `position` property.
|
|
115
|
-
*
|
|
116
|
-
* This method is unstable because the position can be set via another native module and get out of sync.
|
|
117
|
-
* Alternatively, you can get the position by measuring the insets returned by `react-native-safe-area-context`.
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* ```ts
|
|
121
|
-
* await NavigationBar.unstable_getPositionAsync()
|
|
122
|
-
* ```
|
|
123
|
-
* @returns Navigation bar positional rendering mode. Returns `relative` on unsupported platforms (iOS, web).
|
|
124
|
-
*/
|
|
125
|
-
export declare function unstable_getPositionAsync(): Promise<NavigationBarPosition>;
|
|
126
|
-
/**
|
|
127
|
-
* Sets the behavior of the status bar and navigation bar when they are hidden and the user wants to reveal them.
|
|
128
|
-
*
|
|
129
|
-
* For example, if the navigation bar is hidden (`setVisibilityAsync(false)`) and the behavior
|
|
130
|
-
* is `'overlay-swipe'`, the user can swipe from the bottom of the screen to temporarily reveal the navigation bar.
|
|
131
|
-
*
|
|
132
|
-
* - `'overlay-swipe'`: Temporarily reveals the System UI after a swipe gesture (bottom or top) without insetting your App's content.
|
|
133
|
-
* - `'inset-swipe'`: Reveals the System UI after a swipe gesture (bottom or top) and insets your App's content (Safe Area). The System UI is visible until you explicitly hide it again.
|
|
134
|
-
* - `'inset-touch'`: Reveals the System UI after a touch anywhere on the screen and insets your App's content (Safe Area). The System UI is visible until you explicitly hide it again.
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* ```ts
|
|
138
|
-
* await NavigationBar.setBehaviorAsync('overlay-swipe')
|
|
139
|
-
* ```
|
|
140
|
-
* @param behavior Dictates the interaction behavior of the navigation bar.
|
|
141
|
-
*/
|
|
142
|
-
export declare function setBehaviorAsync(behavior: NavigationBarBehavior): Promise<void>;
|
|
143
|
-
/**
|
|
144
|
-
* Gets the behavior of the status and navigation bars when the user swipes or touches the screen.
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```ts
|
|
148
|
-
* await NavigationBar.getBehaviorAsync()
|
|
149
|
-
* ```
|
|
150
|
-
* @returns Navigation bar interaction behavior. Returns `inset-touch` on unsupported platforms (iOS, web).
|
|
151
|
-
*/
|
|
152
|
-
export declare function getBehaviorAsync(): Promise<NavigationBarBehavior>;
|
|
153
|
-
/**
|
|
154
|
-
* React hook that statefully updates with the visibility of the system navigation bar.
|
|
155
|
-
*
|
|
156
|
-
* @example
|
|
157
|
-
* ```ts
|
|
158
|
-
* function App() {
|
|
159
|
-
* const visibility = NavigationBar.useVisibility()
|
|
160
|
-
* // React Component...
|
|
161
|
-
* }
|
|
162
|
-
* ```
|
|
163
|
-
* @returns Visibility of the navigation bar, `null` during async initialization.
|
|
164
|
-
*/
|
|
165
|
-
export declare function useVisibility(): NavigationBarVisibility | null;
|
|
24
|
+
export declare function setVisibilityAsync(visibility: NavigationBarVisibility): Promise<any>;
|
|
25
|
+
export * from './NativeNavigationBarWrapper';
|
|
166
26
|
export * from './NavigationBar.types';
|
|
167
27
|
//# sourceMappingURL=NavigationBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationBar.d.ts","sourceRoot":"","sources":["../src/NavigationBar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavigationBar.d.ts","sourceRoot":"","sources":["../src/NavigationBar.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAoBpF;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,kBAAkB,QAWjD;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,uBAAuB,gBAY3E;AAID,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC"}
|
package/build/NavigationBar.js
CHANGED
|
@@ -1,113 +1,40 @@
|
|
|
1
|
-
import { Platform
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { processColor } from 'react-native';
|
|
1
|
+
import { Platform } from 'react-native';
|
|
4
2
|
import { isEdgeToEdge } from 'react-native-is-edge-to-edge';
|
|
5
3
|
import ExpoNavigationBar from './ExpoNavigationBar';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
// This line only imports the type information for TypeScript type checking.
|
|
5
|
+
// It doesn't import the actual module in the compiled JavaScript code. The actual
|
|
6
|
+
// module is imported conditionally with require() below, in order to avoid
|
|
7
|
+
// importing the module if edge-to-edge is not enabled (which could throw if
|
|
8
|
+
// it's not linked).
|
|
9
|
+
let SystemBars = null;
|
|
10
|
+
if (isEdgeToEdge() && Platform.OS === 'android') {
|
|
11
|
+
SystemBars = require('react-native-edge-to-edge').SystemBars;
|
|
12
|
+
if (!SystemBars) {
|
|
13
|
+
throw new Error('Edge-to-edge has been enabled with `react-native-edge-to-edge`, but `SystemBars` failed to resolve. Make sure your project is configured correctly.');
|
|
11
14
|
}
|
|
12
15
|
}
|
|
16
|
+
const canRunEdgeToEdgeMethods = SystemBars !== null;
|
|
17
|
+
// MARK: react-native-edge-to-edge based APIs
|
|
13
18
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
19
|
+
* Sets the style of the navigation bar.
|
|
20
|
+
* > This will have an effect when the following conditions are met:
|
|
21
|
+
* > - Edge-to-edge is enabled
|
|
22
|
+
* > - The `enforceNavigationBarContrast` option of the `react-native-edge-to-edge` plugin is set to `false`.
|
|
23
|
+
* > - The device is using the three-button navigation bar.
|
|
16
24
|
*
|
|
17
|
-
*
|
|
18
|
-
* ```ts
|
|
19
|
-
* NavigationBar.addVisibilityListener(({ visibility }) => {
|
|
20
|
-
* // ...
|
|
21
|
-
* });
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export function addVisibilityListener(listener) {
|
|
25
|
-
if (__DEV__) {
|
|
26
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
27
|
-
}
|
|
28
|
-
// Assert so the type is non-nullable.
|
|
29
|
-
if (!ExpoNavigationBar.addListener) {
|
|
30
|
-
throw new UnavailabilityError('NavigationBar', 'addVisibilityListener');
|
|
31
|
-
}
|
|
32
|
-
return ExpoNavigationBar.addListener('ExpoNavigationBar.didChange', listener);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Changes the navigation bar's background color.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* NavigationBar.setBackgroundColorAsync("white");
|
|
40
|
-
* ```
|
|
41
|
-
* @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color).
|
|
42
|
-
*/
|
|
43
|
-
export async function setBackgroundColorAsync(color) {
|
|
44
|
-
if (__DEV__) {
|
|
45
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
46
|
-
}
|
|
47
|
-
if (Platform.OS !== 'android') {
|
|
48
|
-
console.warn('`setBackgroundColorAsync` is only available on Android');
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const colorNumber = processColor(color);
|
|
52
|
-
return await ExpoNavigationBar.setBackgroundColorAsync(colorNumber);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Gets the navigation bar's background color.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```ts
|
|
59
|
-
* const color = await NavigationBar.getBackgroundColorAsync();
|
|
60
|
-
* ```
|
|
61
|
-
* @returns Current navigation bar color in hex format. Returns `#00000000` (transparent) on unsupported platforms (iOS, web).
|
|
62
|
-
*/
|
|
63
|
-
export async function getBackgroundColorAsync() {
|
|
64
|
-
if (__DEV__) {
|
|
65
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
66
|
-
}
|
|
67
|
-
if (Platform.OS !== 'android') {
|
|
68
|
-
console.warn('`getBackgroundColorAsync` is only available on Android');
|
|
69
|
-
return `#00000000`;
|
|
70
|
-
}
|
|
71
|
-
return await ExpoNavigationBar.getBackgroundColorAsync();
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Changes the navigation bar's border color.
|
|
25
|
+
* > Due to a bug in the Android 15 emulator this function may have no effect. Try a physical device or an emulator with a different version of Android.
|
|
75
26
|
*
|
|
76
|
-
* @
|
|
77
|
-
* ```ts
|
|
78
|
-
* NavigationBar.setBorderColorAsync("red");
|
|
79
|
-
* ```
|
|
80
|
-
* @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color).
|
|
27
|
+
* @platform android
|
|
81
28
|
*/
|
|
82
|
-
export
|
|
83
|
-
if (
|
|
84
|
-
|
|
29
|
+
export function setStyle(style) {
|
|
30
|
+
if (!canRunEdgeToEdgeMethods && Platform.OS === 'android') {
|
|
31
|
+
throw new Error('`setStyle` is only supported on Android when edge-to-edge is enabled. Enable edge-to-edge or use the `setButtonStyle` function instead.');
|
|
85
32
|
}
|
|
86
33
|
if (Platform.OS !== 'android') {
|
|
87
|
-
console.warn('`
|
|
34
|
+
console.warn('`setStyle` method is only available on Android');
|
|
88
35
|
return;
|
|
89
36
|
}
|
|
90
|
-
|
|
91
|
-
await ExpoNavigationBar.setBorderColorAsync(colorNumber);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Gets the navigation bar's top border color, also known as the "divider color".
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* ```ts
|
|
98
|
-
* const color = await NavigationBar.getBorderColorAsync();
|
|
99
|
-
* ```
|
|
100
|
-
* @returns Navigation bar top border color in hex format. Returns `#00000000` (transparent) on unsupported platforms (iOS, web).
|
|
101
|
-
*/
|
|
102
|
-
export async function getBorderColorAsync() {
|
|
103
|
-
if (__DEV__) {
|
|
104
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
105
|
-
}
|
|
106
|
-
if (Platform.OS !== 'android') {
|
|
107
|
-
console.warn('`getBorderColorAsync` is only available on Android');
|
|
108
|
-
return `#00000000`;
|
|
109
|
-
}
|
|
110
|
-
return await ExpoNavigationBar.getBorderColorAsync();
|
|
37
|
+
SystemBars?.setStyle({ navigationBar: style });
|
|
111
38
|
}
|
|
112
39
|
/**
|
|
113
40
|
* Set the navigation bar's visibility.
|
|
@@ -117,207 +44,20 @@ export async function getBorderColorAsync() {
|
|
|
117
44
|
* NavigationBar.setVisibilityAsync("hidden");
|
|
118
45
|
* ```
|
|
119
46
|
* @param visibility Based on CSS visibility property.
|
|
47
|
+
* @platform android
|
|
120
48
|
*/
|
|
121
49
|
export async function setVisibilityAsync(visibility) {
|
|
122
|
-
if (__DEV__) {
|
|
123
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
124
|
-
}
|
|
125
50
|
if (Platform.OS !== 'android') {
|
|
126
51
|
console.warn('`setVisibilityAsync` is only available on Android');
|
|
127
52
|
return;
|
|
128
53
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
* Get the navigation bar's visibility.
|
|
133
|
-
*
|
|
134
|
-
* @example
|
|
135
|
-
* ```ts
|
|
136
|
-
* const visibility = await NavigationBar.getVisibilityAsync("hidden");
|
|
137
|
-
* ```
|
|
138
|
-
* @returns Navigation bar's current visibility status. Returns `hidden` on unsupported platforms (iOS, web).
|
|
139
|
-
*/
|
|
140
|
-
export async function getVisibilityAsync() {
|
|
141
|
-
if (__DEV__) {
|
|
142
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
143
|
-
}
|
|
144
|
-
if (Platform.OS !== 'android') {
|
|
145
|
-
console.warn('`getVisibilityAsync` is only available on Android');
|
|
146
|
-
return 'hidden';
|
|
147
|
-
}
|
|
148
|
-
return ExpoNavigationBar.getVisibilityAsync();
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Changes the navigation bar's button colors between white (`light`) and a dark gray color (`dark`).
|
|
152
|
-
*
|
|
153
|
-
* @example
|
|
154
|
-
* ```ts
|
|
155
|
-
* NavigationBar.setButtonStyleAsync("light");
|
|
156
|
-
* ```
|
|
157
|
-
* @param style Dictates the color of the foreground element color.
|
|
158
|
-
*/
|
|
159
|
-
export async function setButtonStyleAsync(style) {
|
|
160
|
-
if (__DEV__) {
|
|
161
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
162
|
-
}
|
|
163
|
-
if (Platform.OS !== 'android') {
|
|
164
|
-
console.warn('`setButtonStyleAsync` is only available on Android');
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
await ExpoNavigationBar.setButtonStyleAsync(style);
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Gets the navigation bar's button color styles.
|
|
171
|
-
*
|
|
172
|
-
* @example
|
|
173
|
-
* ```ts
|
|
174
|
-
* const style = await NavigationBar.getButtonStyleAsync();
|
|
175
|
-
* ```
|
|
176
|
-
* @returns Navigation bar foreground element color settings. Returns `light` on unsupported platforms (iOS, web).
|
|
177
|
-
*/
|
|
178
|
-
export async function getButtonStyleAsync() {
|
|
179
|
-
if (__DEV__) {
|
|
180
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
181
|
-
}
|
|
182
|
-
if (Platform.OS !== 'android') {
|
|
183
|
-
console.warn('`getButtonStyleAsync` is only available on Android');
|
|
184
|
-
return 'light';
|
|
185
|
-
}
|
|
186
|
-
return await ExpoNavigationBar.getButtonStyleAsync();
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Sets positioning method used for the navigation bar (and status bar).
|
|
190
|
-
* Setting position `absolute` will float the navigation bar above the content,
|
|
191
|
-
* whereas position `relative` will shrink the screen to inline the navigation bar.
|
|
192
|
-
*
|
|
193
|
-
* When drawing behind the status and navigation bars, ensure the safe area insets are adjusted accordingly.
|
|
194
|
-
*
|
|
195
|
-
* @example
|
|
196
|
-
* ```ts
|
|
197
|
-
* // enables edge-to-edge mode
|
|
198
|
-
* await NavigationBar.setPositionAsync('absolute')
|
|
199
|
-
* // transparent backgrounds to see through
|
|
200
|
-
* await NavigationBar.setBackgroundColorAsync('#ffffff00')
|
|
201
|
-
* ```
|
|
202
|
-
* @param position Based on CSS position property.
|
|
203
|
-
*/
|
|
204
|
-
export async function setPositionAsync(position) {
|
|
205
|
-
if (__DEV__) {
|
|
206
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
207
|
-
}
|
|
208
|
-
if (Platform.OS !== 'android') {
|
|
209
|
-
console.warn('`setPositionAsync` is only available on Android');
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
await ExpoNavigationBar.setPositionAsync(position);
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Whether the navigation and status bars float above the app (absolute) or sit inline with it (relative).
|
|
216
|
-
* This value can be incorrect if `androidNavigationBar.visible` is used instead of the config plugin `position` property.
|
|
217
|
-
*
|
|
218
|
-
* This method is unstable because the position can be set via another native module and get out of sync.
|
|
219
|
-
* Alternatively, you can get the position by measuring the insets returned by `react-native-safe-area-context`.
|
|
220
|
-
*
|
|
221
|
-
* @example
|
|
222
|
-
* ```ts
|
|
223
|
-
* await NavigationBar.unstable_getPositionAsync()
|
|
224
|
-
* ```
|
|
225
|
-
* @returns Navigation bar positional rendering mode. Returns `relative` on unsupported platforms (iOS, web).
|
|
226
|
-
*/
|
|
227
|
-
export async function unstable_getPositionAsync() {
|
|
228
|
-
if (__DEV__) {
|
|
229
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
230
|
-
}
|
|
231
|
-
if (Platform.OS !== 'android') {
|
|
232
|
-
console.warn('`unstable_getPositionAsync` is only available on Android');
|
|
233
|
-
return 'relative';
|
|
234
|
-
}
|
|
235
|
-
return await ExpoNavigationBar.unstable_getPositionAsync();
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Sets the behavior of the status bar and navigation bar when they are hidden and the user wants to reveal them.
|
|
239
|
-
*
|
|
240
|
-
* For example, if the navigation bar is hidden (`setVisibilityAsync(false)`) and the behavior
|
|
241
|
-
* is `'overlay-swipe'`, the user can swipe from the bottom of the screen to temporarily reveal the navigation bar.
|
|
242
|
-
*
|
|
243
|
-
* - `'overlay-swipe'`: Temporarily reveals the System UI after a swipe gesture (bottom or top) without insetting your App's content.
|
|
244
|
-
* - `'inset-swipe'`: Reveals the System UI after a swipe gesture (bottom or top) and insets your App's content (Safe Area). The System UI is visible until you explicitly hide it again.
|
|
245
|
-
* - `'inset-touch'`: Reveals the System UI after a touch anywhere on the screen and insets your App's content (Safe Area). The System UI is visible until you explicitly hide it again.
|
|
246
|
-
*
|
|
247
|
-
* @example
|
|
248
|
-
* ```ts
|
|
249
|
-
* await NavigationBar.setBehaviorAsync('overlay-swipe')
|
|
250
|
-
* ```
|
|
251
|
-
* @param behavior Dictates the interaction behavior of the navigation bar.
|
|
252
|
-
*/
|
|
253
|
-
export async function setBehaviorAsync(behavior) {
|
|
254
|
-
if (__DEV__) {
|
|
255
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
256
|
-
}
|
|
257
|
-
if (Platform.OS !== 'android') {
|
|
258
|
-
console.warn('`setBehaviorAsync` is only available on Android');
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
return await ExpoNavigationBar.setBehaviorAsync(behavior);
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Gets the behavior of the status and navigation bars when the user swipes or touches the screen.
|
|
265
|
-
*
|
|
266
|
-
* @example
|
|
267
|
-
* ```ts
|
|
268
|
-
* await NavigationBar.getBehaviorAsync()
|
|
269
|
-
* ```
|
|
270
|
-
* @returns Navigation bar interaction behavior. Returns `inset-touch` on unsupported platforms (iOS, web).
|
|
271
|
-
*/
|
|
272
|
-
export async function getBehaviorAsync() {
|
|
273
|
-
if (__DEV__) {
|
|
274
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
275
|
-
}
|
|
276
|
-
if (Platform.OS !== 'android') {
|
|
277
|
-
console.warn('`getBehaviorAsync` is only available on Android');
|
|
278
|
-
return 'inset-touch';
|
|
279
|
-
}
|
|
280
|
-
return await ExpoNavigationBar.getBehaviorAsync();
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* React hook that statefully updates with the visibility of the system navigation bar.
|
|
284
|
-
*
|
|
285
|
-
* @example
|
|
286
|
-
* ```ts
|
|
287
|
-
* function App() {
|
|
288
|
-
* const visibility = NavigationBar.useVisibility()
|
|
289
|
-
* // React Component...
|
|
290
|
-
* }
|
|
291
|
-
* ```
|
|
292
|
-
* @returns Visibility of the navigation bar, `null` during async initialization.
|
|
293
|
-
*/
|
|
294
|
-
export function useVisibility() {
|
|
295
|
-
if (__DEV__) {
|
|
296
|
-
potentiallyWarnAboutEdgeToEdge();
|
|
54
|
+
if (canRunEdgeToEdgeMethods) {
|
|
55
|
+
// We know the SystemBars module is available, but typescript doesn't interpret it, so we have to use optional.
|
|
56
|
+
return SystemBars?.setHidden({ navigationBar: visibility === 'hidden' });
|
|
297
57
|
}
|
|
298
|
-
|
|
299
|
-
useEffect(() => {
|
|
300
|
-
let isMounted = true;
|
|
301
|
-
if (Platform.OS !== 'android') {
|
|
302
|
-
setVisible('hidden');
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
getVisibilityAsync().then((visibility) => {
|
|
306
|
-
if (isMounted) {
|
|
307
|
-
setVisible(visibility);
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
const listener = addVisibilityListener(({ visibility }) => {
|
|
311
|
-
if (isMounted) {
|
|
312
|
-
setVisible(visibility);
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
return () => {
|
|
316
|
-
listener.remove();
|
|
317
|
-
isMounted = false;
|
|
318
|
-
};
|
|
319
|
-
}, []);
|
|
320
|
-
return visibility;
|
|
58
|
+
return await ExpoNavigationBar.setVisibilityAsync(visibility);
|
|
321
59
|
}
|
|
60
|
+
// MARK: existing expo-navigation-bar APIs
|
|
61
|
+
export * from './NativeNavigationBarWrapper';
|
|
322
62
|
export * from './NavigationBar.types';
|
|
323
63
|
//# sourceMappingURL=NavigationBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationBar.js","sourceRoot":"","sources":["../src/NavigationBar.ts"],"names":[],"mappings":"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,CAAC;QAChE,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,iBAAiB,CAAC,gBAAgB,EAAE,CAAC;AACpD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa;IAC3B,IAAI,OAAO,EAAE,CAAC;QACZ,8BAA8B,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAiC,IAAI,CAAC,CAAC;IAEhF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,GAAG,IAAI,CAAC;QACrB,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;YAC9B,UAAU,CAAC,QAAQ,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QACD,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE;YACvC,IAAI,SAAS,EAAE,CAAC;gBACd,UAAU,CAAC,UAAU,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,qBAAqB,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;YACxD,IAAI,SAAS,EAAE,CAAC;gBACd,UAAU,CAAC,UAAU,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClB,SAAS,GAAG,KAAK,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,cAAc,uBAAuB,CAAC","sourcesContent":["import { Platform, type EventSubscription, UnavailabilityError } from 'expo-modules-core';\nimport { useEffect, useState } from 'react';\nimport { processColor } from 'react-native';\nimport { isEdgeToEdge } from 'react-native-is-edge-to-edge';\n\nimport ExpoNavigationBar from './ExpoNavigationBar';\nimport {\n NavigationBarButtonStyle,\n NavigationBarBehavior,\n NavigationBarPosition,\n NavigationBarVisibility,\n NavigationBarVisibilityEvent,\n} from './NavigationBar.types';\n\nlet shouldWarnAboutEdgeToEdge = Platform.OS === 'android' && isEdgeToEdge();\n\nfunction potentiallyWarnAboutEdgeToEdge() {\n if (shouldWarnAboutEdgeToEdge) {\n shouldWarnAboutEdgeToEdge = false; // warn once\n console.warn(\n 'Using expo-navigation-bar in apps with edge-to-edge layout enabled may cause unexpected behavior. Instead, use the SystemBars component from react-native-edge-to-edge. Learn more: https://expo.fyi/edge-to-edge-system-bars'\n );\n }\n}\n\n/**\n * Observe changes to the system navigation bar.\n * Due to platform constraints, this callback will also be triggered when the status bar visibility changes.\n *\n * @example\n * ```ts\n * NavigationBar.addVisibilityListener(({ visibility }) => {\n * // ...\n * });\n * ```\n */\nexport function addVisibilityListener(\n listener: (event: NavigationBarVisibilityEvent) => void\n): EventSubscription {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n // Assert so the type is non-nullable.\n if (!ExpoNavigationBar.addListener) {\n throw new UnavailabilityError('NavigationBar', 'addVisibilityListener');\n }\n return ExpoNavigationBar.addListener('ExpoNavigationBar.didChange', listener);\n}\n\n/**\n * Changes the navigation bar's background color.\n *\n * @example\n * ```ts\n * NavigationBar.setBackgroundColorAsync(\"white\");\n * ```\n * @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color).\n */\nexport async function setBackgroundColorAsync(color: string): Promise<void> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`setBackgroundColorAsync` is only available on Android');\n return;\n }\n const colorNumber = processColor(color);\n return await ExpoNavigationBar.setBackgroundColorAsync(colorNumber);\n}\n\n/**\n * Gets the navigation bar's background color.\n *\n * @example\n * ```ts\n * const color = await NavigationBar.getBackgroundColorAsync();\n * ```\n * @returns Current navigation bar color in hex format. Returns `#00000000` (transparent) on unsupported platforms (iOS, web).\n */\nexport async function getBackgroundColorAsync(): Promise<string> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`getBackgroundColorAsync` is only available on Android');\n return `#00000000`;\n }\n return await ExpoNavigationBar.getBackgroundColorAsync();\n}\n\n/**\n * Changes the navigation bar's border color.\n *\n * @example\n * ```ts\n * NavigationBar.setBorderColorAsync(\"red\");\n * ```\n * @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color).\n */\nexport async function setBorderColorAsync(color: string): Promise<void> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`setBorderColorAsync` is only available on Android');\n return;\n }\n const colorNumber = processColor(color);\n await ExpoNavigationBar.setBorderColorAsync(colorNumber);\n}\n\n/**\n * Gets the navigation bar's top border color, also known as the \"divider color\".\n *\n * @example\n * ```ts\n * const color = await NavigationBar.getBorderColorAsync();\n * ```\n * @returns Navigation bar top border color in hex format. Returns `#00000000` (transparent) on unsupported platforms (iOS, web).\n */\nexport async function getBorderColorAsync(): Promise<string> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`getBorderColorAsync` is only available on Android');\n return `#00000000`;\n }\n\n return await ExpoNavigationBar.getBorderColorAsync();\n}\n\n/**\n * Set the navigation bar's visibility.\n *\n * @example\n * ```ts\n * NavigationBar.setVisibilityAsync(\"hidden\");\n * ```\n * @param visibility Based on CSS visibility property.\n */\nexport async function setVisibilityAsync(visibility: NavigationBarVisibility): Promise<void> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`setVisibilityAsync` is only available on Android');\n return;\n }\n await ExpoNavigationBar.setVisibilityAsync(visibility);\n}\n\n/**\n * Get the navigation bar's visibility.\n *\n * @example\n * ```ts\n * const visibility = await NavigationBar.getVisibilityAsync(\"hidden\");\n * ```\n * @returns Navigation bar's current visibility status. Returns `hidden` on unsupported platforms (iOS, web).\n */\nexport async function getVisibilityAsync(): Promise<NavigationBarVisibility> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`getVisibilityAsync` is only available on Android');\n return 'hidden';\n }\n return ExpoNavigationBar.getVisibilityAsync();\n}\n\n/**\n * Changes the navigation bar's button colors between white (`light`) and a dark gray color (`dark`).\n *\n * @example\n * ```ts\n * NavigationBar.setButtonStyleAsync(\"light\");\n * ```\n * @param style Dictates the color of the foreground element color.\n */\nexport async function setButtonStyleAsync(style: NavigationBarButtonStyle): Promise<void> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`setButtonStyleAsync` is only available on Android');\n return;\n }\n await ExpoNavigationBar.setButtonStyleAsync(style);\n}\n\n/**\n * Gets the navigation bar's button color styles.\n *\n * @example\n * ```ts\n * const style = await NavigationBar.getButtonStyleAsync();\n * ```\n * @returns Navigation bar foreground element color settings. Returns `light` on unsupported platforms (iOS, web).\n */\nexport async function getButtonStyleAsync(): Promise<NavigationBarButtonStyle> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`getButtonStyleAsync` is only available on Android');\n return 'light';\n }\n return await ExpoNavigationBar.getButtonStyleAsync();\n}\n\n/**\n * Sets positioning method used for the navigation bar (and status bar).\n * Setting position `absolute` will float the navigation bar above the content,\n * whereas position `relative` will shrink the screen to inline the navigation bar.\n *\n * When drawing behind the status and navigation bars, ensure the safe area insets are adjusted accordingly.\n *\n * @example\n * ```ts\n * // enables edge-to-edge mode\n * await NavigationBar.setPositionAsync('absolute')\n * // transparent backgrounds to see through\n * await NavigationBar.setBackgroundColorAsync('#ffffff00')\n * ```\n * @param position Based on CSS position property.\n */\nexport async function setPositionAsync(position: NavigationBarPosition): Promise<void> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`setPositionAsync` is only available on Android');\n return;\n }\n await ExpoNavigationBar.setPositionAsync(position);\n}\n\n/**\n * Whether the navigation and status bars float above the app (absolute) or sit inline with it (relative).\n * This value can be incorrect if `androidNavigationBar.visible` is used instead of the config plugin `position` property.\n *\n * This method is unstable because the position can be set via another native module and get out of sync.\n * Alternatively, you can get the position by measuring the insets returned by `react-native-safe-area-context`.\n *\n * @example\n * ```ts\n * await NavigationBar.unstable_getPositionAsync()\n * ```\n * @returns Navigation bar positional rendering mode. Returns `relative` on unsupported platforms (iOS, web).\n */\nexport async function unstable_getPositionAsync(): Promise<NavigationBarPosition> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`unstable_getPositionAsync` is only available on Android');\n return 'relative';\n }\n return await ExpoNavigationBar.unstable_getPositionAsync();\n}\n\n/**\n * Sets the behavior of the status bar and navigation bar when they are hidden and the user wants to reveal them.\n *\n * For example, if the navigation bar is hidden (`setVisibilityAsync(false)`) and the behavior\n * is `'overlay-swipe'`, the user can swipe from the bottom of the screen to temporarily reveal the navigation bar.\n *\n * - `'overlay-swipe'`: Temporarily reveals the System UI after a swipe gesture (bottom or top) without insetting your App's content.\n * - `'inset-swipe'`: Reveals the System UI after a swipe gesture (bottom or top) and insets your App's content (Safe Area). The System UI is visible until you explicitly hide it again.\n * - `'inset-touch'`: Reveals the System UI after a touch anywhere on the screen and insets your App's content (Safe Area). The System UI is visible until you explicitly hide it again.\n *\n * @example\n * ```ts\n * await NavigationBar.setBehaviorAsync('overlay-swipe')\n * ```\n * @param behavior Dictates the interaction behavior of the navigation bar.\n */\nexport async function setBehaviorAsync(behavior: NavigationBarBehavior): Promise<void> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`setBehaviorAsync` is only available on Android');\n return;\n }\n return await ExpoNavigationBar.setBehaviorAsync(behavior);\n}\n\n/**\n * Gets the behavior of the status and navigation bars when the user swipes or touches the screen.\n *\n * @example\n * ```ts\n * await NavigationBar.getBehaviorAsync()\n * ```\n * @returns Navigation bar interaction behavior. Returns `inset-touch` on unsupported platforms (iOS, web).\n */\nexport async function getBehaviorAsync(): Promise<NavigationBarBehavior> {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n if (Platform.OS !== 'android') {\n console.warn('`getBehaviorAsync` is only available on Android');\n return 'inset-touch';\n }\n return await ExpoNavigationBar.getBehaviorAsync();\n}\n\n/**\n * React hook that statefully updates with the visibility of the system navigation bar.\n *\n * @example\n * ```ts\n * function App() {\n * const visibility = NavigationBar.useVisibility()\n * // React Component...\n * }\n * ```\n * @returns Visibility of the navigation bar, `null` during async initialization.\n */\nexport function useVisibility(): NavigationBarVisibility | null {\n if (__DEV__) {\n potentiallyWarnAboutEdgeToEdge();\n }\n\n const [visibility, setVisible] = useState<NavigationBarVisibility | null>(null);\n\n useEffect(() => {\n let isMounted = true;\n if (Platform.OS !== 'android') {\n setVisible('hidden');\n return;\n }\n getVisibilityAsync().then((visibility) => {\n if (isMounted) {\n setVisible(visibility);\n }\n });\n\n const listener = addVisibilityListener(({ visibility }) => {\n if (isMounted) {\n setVisible(visibility);\n }\n });\n\n return () => {\n listener.remove();\n isMounted = false;\n };\n }, []);\n\n return visibility;\n}\n\nexport * from './NavigationBar.types';\n"]}
|
|
1
|
+
{"version":3,"file":"NavigationBar.js","sourceRoot":"","sources":["../src/NavigationBar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAGpD,4EAA4E;AAC5E,kFAAkF;AAClF,2EAA2E;AAC3E,4EAA4E;AAC5E,oBAAoB;AACpB,IAAI,UAAU,GAAiE,IAAI,CAAC;AAEpF,IAAI,YAAY,EAAE,IAAI,QA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Edge } from 'react-native-is-edge-to-edge';\n\nimport ExpoNavigationBar from './ExpoNavigationBar';\nimport { NavigationBarStyle, NavigationBarVisibility } from './NavigationBar.types';\n\n// This line only imports the type information for TypeScript type checking.\n// It doesn't import the actual module in the compiled JavaScript code. The actual\n// module is imported conditionally with require() below, in order to avoid\n// importing the module if edge-to-edge is not enabled (which could throw if\n// it's not linked).\nlet SystemBars: typeof import('react-native-edge-to-edge').SystemBars | null = null;\n\nif (isEdgeToEdge() && Platform.OS === 'android') {\n SystemBars = require('react-native-edge-to-edge').SystemBars;\n if (!SystemBars) {\n throw new Error(\n 'Edge-to-edge has been enabled with `react-native-edge-to-edge`, but `SystemBars` failed to resolve. Make sure your project is configured correctly.'\n );\n }\n}\nconst canRunEdgeToEdgeMethods = SystemBars !== null;\n\n// MARK: react-native-edge-to-edge based APIs\n/**\n * Sets the style of the navigation bar.\n * > This will have an effect when the following conditions are met:\n * > - Edge-to-edge is enabled\n * > - The `enforceNavigationBarContrast` option of the `react-native-edge-to-edge` plugin is set to `false`.\n * > - The device is using the three-button navigation bar.\n *\n * > Due to a bug in the Android 15 emulator this function may have no effect. Try a physical device or an emulator with a different version of Android.\n *\n * @platform android\n */\nexport function setStyle(style: NavigationBarStyle) {\n if (!canRunEdgeToEdgeMethods && Platform.OS === 'android') {\n throw new Error(\n '`setStyle` is only supported on Android when edge-to-edge is enabled. Enable edge-to-edge or use the `setButtonStyle` function instead.'\n );\n }\n if (Platform.OS !== 'android') {\n console.warn('`setStyle` method is only available on Android');\n return;\n }\n SystemBars?.setStyle({ navigationBar: style });\n}\n\n/**\n * Set the navigation bar's visibility.\n *\n * @example\n * ```ts\n * NavigationBar.setVisibilityAsync(\"hidden\");\n * ```\n * @param visibility Based on CSS visibility property.\n * @platform android\n */\nexport async function setVisibilityAsync(visibility: NavigationBarVisibility) {\n if (Platform.OS !== 'android') {\n console.warn('`setVisibilityAsync` is only available on Android');\n return;\n }\n\n if (canRunEdgeToEdgeMethods) {\n // We know the SystemBars module is available, but typescript doesn't interpret it, so we have to use optional.\n return SystemBars?.setHidden({ navigationBar: visibility === 'hidden' });\n }\n\n return await ExpoNavigationBar.setVisibilityAsync(visibility);\n}\n\n// MARK: existing expo-navigation-bar APIs\n\nexport * from './NativeNavigationBarWrapper';\nexport * from './NavigationBar.types';\n"]}
|
|
@@ -30,4 +30,13 @@ export type NavigationBarVisibilityEvent = {
|
|
|
30
30
|
*/
|
|
31
31
|
rawVisibility: number;
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Navigation bar style.
|
|
35
|
+
*
|
|
36
|
+
* - `auto` will automatically adjust based on the current theme.
|
|
37
|
+
* - `light` a light navigation bar with dark content.
|
|
38
|
+
* - `dark` a dark navigation bar with light content.
|
|
39
|
+
* - `inverted` the bar colors are inverted in relation to the current theme.
|
|
40
|
+
*/
|
|
41
|
+
export type NavigationBarStyle = 'auto' | 'inverted' | 'light' | 'dark';
|
|
33
42
|
//# sourceMappingURL=NavigationBar.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationBar.types.d.ts","sourceRoot":"","sources":["../src/NavigationBar.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,eAAe,GAAG,aAAa,GAAG,aAAa,CAAC;AAEpF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,UAAU,EAAE,uBAAuB,CAAC;IACpC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
1
|
+
{"version":3,"file":"NavigationBar.types.d.ts","sourceRoot":"","sources":["../src/NavigationBar.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,eAAe,GAAG,aAAa,GAAG,aAAa,CAAC;AAEpF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,UAAU,EAAE,uBAAuB,CAAC;IACpC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationBar.types.js","sourceRoot":"","sources":["../src/NavigationBar.types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Appearance of the foreground elements in the navigation bar, i.e. the color of the menu, back, home button icons.\n *\n * - `dark` makes buttons **darker** to adjust for a mostly light nav bar.\n * - `light` makes buttons **lighter** to adjust for a mostly dark nav bar.\n */\nexport type NavigationBarButtonStyle = 'light' | 'dark';\n\n/**\n * Visibility of the navigation bar.\n */\nexport type NavigationBarVisibility = 'visible' | 'hidden';\n\n/**\n * Interaction behavior for the system navigation bar.\n */\nexport type NavigationBarBehavior = 'overlay-swipe' | 'inset-swipe' | 'inset-touch';\n\n/**\n * Navigation bar positional mode.\n */\nexport type NavigationBarPosition = 'relative' | 'absolute';\n\n/**\n * Current system UI visibility state. Due to platform constraints, this will return when the status bar visibility changes as well as the navigation bar.\n */\nexport type NavigationBarVisibilityEvent = {\n /**\n * Current navigation bar visibility.\n */\n visibility: NavigationBarVisibility;\n /**\n * Native Android system UI visibility state, returned from the native Android `setOnSystemUiVisibilityChangeListener` API.\n */\n rawVisibility: number;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"NavigationBar.types.js","sourceRoot":"","sources":["../src/NavigationBar.types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Appearance of the foreground elements in the navigation bar, i.e. the color of the menu, back, home button icons.\n *\n * - `dark` makes buttons **darker** to adjust for a mostly light nav bar.\n * - `light` makes buttons **lighter** to adjust for a mostly dark nav bar.\n */\nexport type NavigationBarButtonStyle = 'light' | 'dark';\n\n/**\n * Visibility of the navigation bar.\n */\nexport type NavigationBarVisibility = 'visible' | 'hidden';\n\n/**\n * Interaction behavior for the system navigation bar.\n */\nexport type NavigationBarBehavior = 'overlay-swipe' | 'inset-swipe' | 'inset-touch';\n\n/**\n * Navigation bar positional mode.\n */\nexport type NavigationBarPosition = 'relative' | 'absolute';\n\n/**\n * Current system UI visibility state. Due to platform constraints, this will return when the status bar visibility changes as well as the navigation bar.\n */\nexport type NavigationBarVisibilityEvent = {\n /**\n * Current navigation bar visibility.\n */\n visibility: NavigationBarVisibility;\n /**\n * Native Android system UI visibility state, returned from the native Android `setOnSystemUiVisibilityChangeListener` API.\n */\n rawVisibility: number;\n};\n\n/**\n * Navigation bar style.\n *\n * - `auto` will automatically adjust based on the current theme.\n * - `light` a light navigation bar with dark content.\n * - `dark` a dark navigation bar with light content.\n * - `inverted` the bar colors are inverted in relation to the current theme.\n */\nexport type NavigationBarStyle = 'auto' | 'inverted' | 'light' | 'dark';\n"]}
|