4.0.2 • Published 5 months ago
@donald_sh/capacitor-navigation-bar v4.0.2
Maintainers
| Maintainer | GitHub | Social |
|---|---|---|
| Hugo Tomazi | hugotomazi | @donald_sh |
Install
npm install git+https://github.com/donald_sh/navigation-bar.git
npx cap syncConfiguration
No configuration required for this plugin.
API
show()hide()setColor(...)setTransparency(...)getColor()addListener(NavigationBarPluginEvents.SHOW, ...)addListener(NavigationBarPluginEvents.HIDE, ...)addListener(NavigationBarPluginEvents.COLOR_CHANGE, ...)- Interfaces
- Enums
show()
show() => Promise<void>Display the navigation bar.
hide()
hide() => Promise<void>Hide the navigation bar.
setColor(...)
setColor(options: ColorParameters) => Promise<void>Change the color of the navigation bar. *Support alpha hexadecimal numbers.
| Param | Type |
|---|---|
options | ColorParameters |
setTransparency(...)
setTransparency(options: { isTransparent: boolean; }) => Promise<void>Set the Transparency
| Param | Type |
|---|---|
options | { isTransparent: boolean; } |
getColor()
getColor() => Promise<{ color: string; }>Gets the current color of the navigation bar in Hexadecimal.
Returns: Promise<{ color: string; }>
addListener(NavigationBarPluginEvents.SHOW, ...)
addListener(event: NavigationBarPluginEvents.SHOW, listenerFunc: () => void) => Promise<PluginListenerHandle>Event fired after navigation bar is displayed
| Param | Type | Description |
|---|---|---|
event | NavigationBarPluginEvents.SHOW | The event |
listenerFunc | () => void | Callback |
Returns: Promise<PluginListenerHandle>
addListener(NavigationBarPluginEvents.HIDE, ...)
addListener(event: NavigationBarPluginEvents.HIDE, listenerFunc: () => void) => Promise<PluginListenerHandle>Event fired after navigation bar is hidden
| Param | Type | Description |
|---|---|---|
event | NavigationBarPluginEvents.HIDE | The event |
listenerFunc | () => void | Callback |
Returns: Promise<PluginListenerHandle>
addListener(NavigationBarPluginEvents.COLOR_CHANGE, ...)
addListener(event: NavigationBarPluginEvents.COLOR_CHANGE, listenerFunc: (returnObject: { color: string; }) => void) => Promise<PluginListenerHandle>Event fired after navigation bar color is changed
| Param | Type | Description |
|---|---|---|
event | NavigationBarPluginEvents.COLOR_CHANGE | The event |
listenerFunc | (returnObject: { color: string; }) => void | Callback |
Returns: Promise<PluginListenerHandle>
Interfaces
ColorParameters
| Prop | Type | Description |
|---|---|---|
color | string | Sets the new color of the navigation bar. |
darkButtons | boolean | Sets whether the default navigation bar buttons should be black or white. |
PluginListenerHandle
| Prop | Type |
|---|---|
remove | () => Promise<void> |
Enums
NavigationBarPluginEvents
| Members | Value | Description |
|---|---|---|
SHOW | 'onShow' | Called after the navigation bar is displayed |
HIDE | 'onHide' | Called after navigation bar is hidden |
COLOR_CHANGE | 'onColorChange' | Called after navigation bar color is changed |
4.0.2
5 months ago