@capgo/capacitor-navigation-bar 7.1.2 → 7.1.8

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 CHANGED
@@ -21,6 +21,7 @@ npx cap sync
21
21
 
22
22
  * [`setNavigationBarColor(...)`](#setnavigationbarcolor)
23
23
  * [`getNavigationBarColor()`](#getnavigationbarcolor)
24
+ * [Enums](#enums)
24
25
 
25
26
  </docgen-index>
26
27
 
@@ -30,12 +31,12 @@ npx cap sync
30
31
  ### setNavigationBarColor(...)
31
32
 
32
33
  ```typescript
33
- setNavigationBarColor(options: { color: string; }) => Promise<void>
34
+ setNavigationBarColor(options: { color: NavigationBarColor | string; buttonStyle?: NavigationBarButtonStyle; }) => Promise<void>
34
35
  ```
35
36
 
36
- | Param | Type |
37
- | ------------- | ------------------------------- |
38
- | **`options`** | <code>{ color: string; }</code> |
37
+ | Param | Type |
38
+ | ------------- | --------------------------------------------------------------------------------------------------------------- |
39
+ | **`options`** | <code>{ color: string; buttonStyle?: <a href="#navigationbarbuttonstyle">NavigationBarButtonStyle</a>; }</code> |
39
40
 
40
41
  --------------------
41
42
 
@@ -43,11 +44,31 @@ setNavigationBarColor(options: { color: string; }) => Promise<void>
43
44
  ### getNavigationBarColor()
44
45
 
45
46
  ```typescript
46
- getNavigationBarColor() => Promise<{ color: string; }>
47
+ getNavigationBarColor() => Promise<{ color: string; buttonStyle: NavigationBarButtonStyle; }>
47
48
  ```
48
49
 
49
- **Returns:** <code>Promise&lt;{ color: string; }&gt;</code>
50
+ **Returns:** <code>Promise&lt;{ color: string; buttonStyle: <a href="#navigationbarbuttonstyle">NavigationBarButtonStyle</a>; }&gt;</code>
50
51
 
51
52
  --------------------
52
53
 
54
+
55
+ ### Enums
56
+
57
+
58
+ #### NavigationBarColor
59
+
60
+ | Members | Value |
61
+ | ----------------- | -------------------------- |
62
+ | **`WHITE`** | <code>"#FFFFFF"</code> |
63
+ | **`BLACK`** | <code>"#000000"</code> |
64
+ | **`TRANSPARENT`** | <code>"transparent"</code> |
65
+
66
+
67
+ #### NavigationBarButtonStyle
68
+
69
+ | Members | Value |
70
+ | ----------- | ---------------------- |
71
+ | **`LIGHT`** | <code>"#FFFFFF"</code> |
72
+ | **`DARK`** | <code>"#000000"</code> |
73
+
53
74
  </docgen-api>
@@ -1,6 +1,8 @@
1
1
  package ee.forgr.capacitor_navigation_bar;
2
2
 
3
+ import android.graphics.Color;
3
4
  import android.os.Build;
5
+ import android.view.View;
4
6
  import com.getcapacitor.JSObject;
5
7
  import com.getcapacitor.Plugin;
6
8
  import com.getcapacitor.PluginCall;
@@ -15,6 +17,8 @@ public class NavigationBarPlugin extends Plugin {
15
17
  @PluginMethod
16
18
  public void setNavigationBarColor(PluginCall call) {
17
19
  final String color = call.getString("color");
20
+ final String buttonStyle = call.getString("buttonStyle", "#FFFFFF");
21
+
18
22
  if (color == null) {
19
23
  call.reject("Color must be provided");
20
24
  return;
@@ -23,18 +27,51 @@ public class NavigationBarPlugin extends Plugin {
23
27
  getBridge()
24
28
  .executeOnMainThread(() -> {
25
29
  try {
26
- final int parsedColor = WebColor.parseColor(
27
- color.toUpperCase(Locale.ROOT)
28
- );
29
30
  if (
30
31
  android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
31
32
  ) {
32
- getActivity().getWindow().setNavigationBarColor(parsedColor);
33
+ if ("transparent".equals(color.toLowerCase())) {
34
+ int flags = getActivity()
35
+ .getWindow()
36
+ .getDecorView()
37
+ .getSystemUiVisibility();
38
+ flags |=
39
+ View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
40
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
41
+ getActivity()
42
+ .getWindow()
43
+ .getDecorView()
44
+ .setSystemUiVisibility(flags);
45
+ getActivity()
46
+ .getWindow()
47
+ .setNavigationBarColor(Color.TRANSPARENT);
48
+ } else {
49
+ final int parsedColor = WebColor.parseColor(
50
+ color.toUpperCase(Locale.ROOT)
51
+ );
52
+ getActivity().getWindow().setNavigationBarColor(parsedColor);
53
+ }
54
+
55
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
56
+ int flags = getActivity()
57
+ .getWindow()
58
+ .getDecorView()
59
+ .getSystemUiVisibility();
60
+ if (buttonStyle.equals("#000000")) {
61
+ flags |= View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
62
+ } else {
63
+ flags &= ~View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
64
+ }
65
+ getActivity()
66
+ .getWindow()
67
+ .getDecorView()
68
+ .setSystemUiVisibility(flags);
69
+ }
33
70
  }
34
71
  call.resolve();
35
72
  } catch (IllegalArgumentException ex) {
36
73
  call.reject(
37
- "Invalid color provided. Must be a hex string (ex: #ff0000"
74
+ "Invalid color provided. Must be a hex color (#RRGGBB) or 'transparent'"
38
75
  );
39
76
  }
40
77
  });
@@ -45,22 +82,35 @@ public class NavigationBarPlugin extends Plugin {
45
82
  getBridge()
46
83
  .executeOnMainThread(() -> {
47
84
  try {
85
+ JSObject ret = new JSObject();
48
86
  if (
49
87
  android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
50
88
  ) {
51
- JSObject ret = new JSObject();
52
89
  int intColor = getActivity().getWindow().getNavigationBarColor();
53
90
  String hexColor = String.format("#%06X", (0xFFFFFF & intColor));
54
91
  ret.put("color", hexColor);
92
+
93
+ String buttonStyle = "#FFFFFF"; // LIGHT
94
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
95
+ int flags = getActivity()
96
+ .getWindow()
97
+ .getDecorView()
98
+ .getSystemUiVisibility();
99
+ if ((flags & View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR) != 0) {
100
+ buttonStyle = "#000000"; // DARK
101
+ }
102
+ }
103
+ ret.put("buttonStyle", buttonStyle);
104
+
55
105
  call.resolve(ret);
56
106
  return;
57
107
  }
58
- JSObject ret = new JSObject();
59
108
  ret.put("color", "#000000");
109
+ ret.put("buttonStyle", "#FFFFFF");
60
110
  call.resolve(ret);
61
111
  } catch (IllegalArgumentException ex) {
62
112
  call.reject(
63
- "Invalid color provided. Must be a hex string (ex: #ff0000"
113
+ "Invalid color provided. Must be a hex color (#RRGGBB or #RRGGBBAA for transparency)"
64
114
  );
65
115
  }
66
116
  });
package/dist/docs.json CHANGED
@@ -7,35 +7,83 @@
7
7
  "methods": [
8
8
  {
9
9
  "name": "setNavigationBarColor",
10
- "signature": "(options: { color: string; }) => Promise<void>",
10
+ "signature": "(options: { color: NavigationBarColor | string; buttonStyle?: NavigationBarButtonStyle; }) => Promise<void>",
11
11
  "parameters": [
12
12
  {
13
13
  "name": "options",
14
14
  "docs": "",
15
- "type": "{ color: string; }"
15
+ "type": "{ color: string; buttonStyle?: NavigationBarButtonStyle | undefined; }"
16
16
  }
17
17
  ],
18
18
  "returns": "Promise<void>",
19
19
  "tags": [],
20
20
  "docs": "",
21
- "complexTypes": [],
21
+ "complexTypes": [
22
+ "NavigationBarColor",
23
+ "NavigationBarButtonStyle"
24
+ ],
22
25
  "slug": "setnavigationbarcolor"
23
26
  },
24
27
  {
25
28
  "name": "getNavigationBarColor",
26
- "signature": "() => Promise<{ color: string; }>",
29
+ "signature": "() => Promise<{ color: string; buttonStyle: NavigationBarButtonStyle; }>",
27
30
  "parameters": [],
28
- "returns": "Promise<{ color: string; }>",
31
+ "returns": "Promise<{ color: string; buttonStyle: NavigationBarButtonStyle; }>",
29
32
  "tags": [],
30
33
  "docs": "",
31
- "complexTypes": [],
34
+ "complexTypes": [
35
+ "NavigationBarButtonStyle"
36
+ ],
32
37
  "slug": "getnavigationbarcolor"
33
38
  }
34
39
  ],
35
40
  "properties": []
36
41
  },
37
42
  "interfaces": [],
38
- "enums": [],
43
+ "enums": [
44
+ {
45
+ "name": "NavigationBarColor",
46
+ "slug": "navigationbarcolor",
47
+ "members": [
48
+ {
49
+ "name": "WHITE",
50
+ "value": "\"#FFFFFF\"",
51
+ "tags": [],
52
+ "docs": ""
53
+ },
54
+ {
55
+ "name": "BLACK",
56
+ "value": "\"#000000\"",
57
+ "tags": [],
58
+ "docs": ""
59
+ },
60
+ {
61
+ "name": "TRANSPARENT",
62
+ "value": "\"transparent\"",
63
+ "tags": [],
64
+ "docs": ""
65
+ }
66
+ ]
67
+ },
68
+ {
69
+ "name": "NavigationBarButtonStyle",
70
+ "slug": "navigationbarbuttonstyle",
71
+ "members": [
72
+ {
73
+ "name": "LIGHT",
74
+ "value": "\"#FFFFFF\"",
75
+ "tags": [],
76
+ "docs": ""
77
+ },
78
+ {
79
+ "name": "DARK",
80
+ "value": "\"#000000\"",
81
+ "tags": [],
82
+ "docs": ""
83
+ }
84
+ ]
85
+ }
86
+ ],
39
87
  "typeAliases": [],
40
88
  "pluginConfigs": []
41
89
  }
@@ -1,8 +1,19 @@
1
+ export declare enum NavigationBarButtonStyle {
2
+ LIGHT = "#FFFFFF",
3
+ DARK = "#000000"
4
+ }
5
+ export declare enum NavigationBarColor {
6
+ WHITE = "#FFFFFF",
7
+ BLACK = "#000000",
8
+ TRANSPARENT = "transparent"
9
+ }
1
10
  export interface NavigationBarPlugin {
2
11
  setNavigationBarColor(options: {
3
- color: string;
12
+ color: NavigationBarColor | string;
13
+ buttonStyle?: NavigationBarButtonStyle;
4
14
  }): Promise<void>;
5
15
  getNavigationBarColor(): Promise<{
6
16
  color: string;
17
+ buttonStyle: NavigationBarButtonStyle;
7
18
  }>;
8
19
  }
@@ -1,2 +1,12 @@
1
- export {};
1
+ export var NavigationBarButtonStyle;
2
+ (function (NavigationBarButtonStyle) {
3
+ NavigationBarButtonStyle["LIGHT"] = "#FFFFFF";
4
+ NavigationBarButtonStyle["DARK"] = "#000000";
5
+ })(NavigationBarButtonStyle || (NavigationBarButtonStyle = {}));
6
+ export var NavigationBarColor;
7
+ (function (NavigationBarColor) {
8
+ NavigationBarColor["WHITE"] = "#FFFFFF";
9
+ NavigationBarColor["BLACK"] = "#000000";
10
+ NavigationBarColor["TRANSPARENT"] = "transparent";
11
+ })(NavigationBarColor || (NavigationBarColor = {}));
2
12
  //# sourceMappingURL=definitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface NavigationBarPlugin {\n setNavigationBarColor(options: { color: string }): Promise<void>;\n getNavigationBarColor(): Promise<{ color: string }>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,6CAAiB,CAAA;IACjB,4CAAgB,CAAA;AAClB,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,QAGnC;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,iDAA2B,CAAA;AAC7B,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["export enum NavigationBarButtonStyle {\n LIGHT = \"#FFFFFF\",\n DARK = \"#000000\",\n}\n\nexport enum NavigationBarColor {\n WHITE = \"#FFFFFF\",\n BLACK = \"#000000\",\n TRANSPARENT = \"transparent\",\n}\n\nexport interface NavigationBarPlugin {\n setNavigationBarColor(options: {\n color: NavigationBarColor | string; // Predefined colors or any valid hex\n buttonStyle?: NavigationBarButtonStyle; // Button color theme\n }): Promise<void>;\n getNavigationBarColor(): Promise<{\n color: string;\n buttonStyle: NavigationBarButtonStyle;\n }>;\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { WebPlugin } from "@capacitor/core";
2
+ import { NavigationBarButtonStyle } from "./definitions";
2
3
  import type { NavigationBarPlugin } from "./definitions";
3
4
  export declare class NavigationBarWeb extends WebPlugin implements NavigationBarPlugin {
4
5
  setNavigationBarColor(options: {
@@ -6,5 +7,6 @@ export declare class NavigationBarWeb extends WebPlugin implements NavigationBar
6
7
  }): Promise<void>;
7
8
  getNavigationBarColor(): Promise<{
8
9
  color: string;
10
+ buttonStyle: NavigationBarButtonStyle;
9
11
  }>;
10
12
  }
package/dist/esm/web.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { WebPlugin } from "@capacitor/core";
2
+ import { NavigationBarButtonStyle } from "./definitions";
2
3
  export class NavigationBarWeb extends WebPlugin {
3
4
  async setNavigationBarColor(options) {
4
5
  console.log("Cannot setNavigationBarColor on web", options);
@@ -6,7 +7,7 @@ export class NavigationBarWeb extends WebPlugin {
6
7
  }
7
8
  async getNavigationBarColor() {
8
9
  console.log("Cannot getNavigationBarColor on web");
9
- return { color: "#000000" };
10
+ return { color: "#000000", buttonStyle: NavigationBarButtonStyle.DARK };
10
11
  }
11
12
  }
12
13
  //# sourceMappingURL=web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAC7C,KAAK,CAAC,qBAAqB,CAAC,OAA0B;QACpD,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,OAAO,CAAC,CAAC;QAC5D,OAAO;IACT,CAAC;IACD,KAAK,CAAC,qBAAqB;QACzB,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QACnD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAC9B,CAAC;CACF","sourcesContent":["import { WebPlugin } from \"@capacitor/core\";\n\nimport type { NavigationBarPlugin } from \"./definitions\";\n\nexport class NavigationBarWeb extends WebPlugin implements NavigationBarPlugin {\n async setNavigationBarColor(options: { color: string }): Promise<void> {\n console.log(\"Cannot setNavigationBarColor on web\", options);\n return;\n }\n async getNavigationBarColor(): Promise<{ color: string }> {\n console.log(\"Cannot getNavigationBarColor on web\");\n return { color: \"#000000\" };\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAGzD,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAC7C,KAAK,CAAC,qBAAqB,CAAC,OAA0B;QACpD,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,OAAO,CAAC,CAAC;QAC5D,OAAO;IACT,CAAC;IACD,KAAK,CAAC,qBAAqB;QAIzB,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QACnD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,wBAAwB,CAAC,IAAI,EAAE,CAAC;IAC1E,CAAC;CACF","sourcesContent":["import { WebPlugin } from \"@capacitor/core\";\n\nimport { NavigationBarButtonStyle } from \"./definitions\";\nimport type { NavigationBarPlugin } from \"./definitions\";\n\nexport class NavigationBarWeb extends WebPlugin implements NavigationBarPlugin {\n async setNavigationBarColor(options: { color: string }): Promise<void> {\n console.log(\"Cannot setNavigationBarColor on web\", options);\n return;\n }\n async getNavigationBarColor(): Promise<{\n color: string;\n buttonStyle: NavigationBarButtonStyle;\n }> {\n console.log(\"Cannot getNavigationBarColor on web\");\n return { color: \"#000000\", buttonStyle: NavigationBarButtonStyle.DARK };\n }\n}\n"]}
@@ -2,6 +2,18 @@
2
2
 
3
3
  var core = require('@capacitor/core');
4
4
 
5
+ exports.NavigationBarButtonStyle = void 0;
6
+ (function (NavigationBarButtonStyle) {
7
+ NavigationBarButtonStyle["LIGHT"] = "#FFFFFF";
8
+ NavigationBarButtonStyle["DARK"] = "#000000";
9
+ })(exports.NavigationBarButtonStyle || (exports.NavigationBarButtonStyle = {}));
10
+ exports.NavigationBarColor = void 0;
11
+ (function (NavigationBarColor) {
12
+ NavigationBarColor["WHITE"] = "#FFFFFF";
13
+ NavigationBarColor["BLACK"] = "#000000";
14
+ NavigationBarColor["TRANSPARENT"] = "transparent";
15
+ })(exports.NavigationBarColor || (exports.NavigationBarColor = {}));
16
+
5
17
  const NavigationBar = core.registerPlugin("NavigationBar", {
6
18
  web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.NavigationBarWeb()),
7
19
  });
@@ -13,7 +25,7 @@ class NavigationBarWeb extends core.WebPlugin {
13
25
  }
14
26
  async getNavigationBarColor() {
15
27
  console.log("Cannot getNavigationBarColor on web");
16
- return { color: "#000000" };
28
+ return { color: "#000000", buttonStyle: exports.NavigationBarButtonStyle.DARK };
17
29
  }
18
30
  }
19
31
 
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nconst NavigationBar = registerPlugin(\"NavigationBar\", {\n web: () => import(\"./web\").then((m) => new m.NavigationBarWeb()),\n});\nexport * from \"./definitions\";\nexport { NavigationBar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport class NavigationBarWeb extends WebPlugin {\n async setNavigationBarColor(options) {\n console.log(\"Cannot setNavigationBarColor on web\", options);\n return;\n }\n async getNavigationBarColor() {\n console.log(\"Cannot getNavigationBarColor on web\");\n return { color: \"#000000\" };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,aAAa,GAAGA,mBAAc,CAAC,eAAe,EAAE;AACtD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;AACpE,CAAC;;ACFM,MAAM,gBAAgB,SAASC,cAAS,CAAC;AAChD,IAAI,MAAM,qBAAqB,CAAC,OAAO,EAAE;AACzC,QAAQ,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,OAAO,CAAC;AACnE,QAAQ;AACR;AACA,IAAI,MAAM,qBAAqB,GAAG;AAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC;AAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE;AACnC;AACA;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var NavigationBarButtonStyle;\n(function (NavigationBarButtonStyle) {\n NavigationBarButtonStyle[\"LIGHT\"] = \"#FFFFFF\";\n NavigationBarButtonStyle[\"DARK\"] = \"#000000\";\n})(NavigationBarButtonStyle || (NavigationBarButtonStyle = {}));\nexport var NavigationBarColor;\n(function (NavigationBarColor) {\n NavigationBarColor[\"WHITE\"] = \"#FFFFFF\";\n NavigationBarColor[\"BLACK\"] = \"#000000\";\n NavigationBarColor[\"TRANSPARENT\"] = \"transparent\";\n})(NavigationBarColor || (NavigationBarColor = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst NavigationBar = registerPlugin(\"NavigationBar\", {\n web: () => import(\"./web\").then((m) => new m.NavigationBarWeb()),\n});\nexport * from \"./definitions\";\nexport { NavigationBar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nimport { NavigationBarButtonStyle } from \"./definitions\";\nexport class NavigationBarWeb extends WebPlugin {\n async setNavigationBarColor(options) {\n console.log(\"Cannot setNavigationBarColor on web\", options);\n return;\n }\n async getNavigationBarColor() {\n console.log(\"Cannot getNavigationBarColor on web\");\n return { color: \"#000000\", buttonStyle: NavigationBarButtonStyle.DARK };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["NavigationBarButtonStyle","NavigationBarColor","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,wBAAwB,EAAE;AACrC,IAAI,wBAAwB,CAAC,OAAO,CAAC,GAAG,SAAS;AACjD,IAAI,wBAAwB,CAAC,MAAM,CAAC,GAAG,SAAS;AAChD,CAAC,EAAEA,gCAAwB,KAAKA,gCAAwB,GAAG,EAAE,CAAC,CAAC;AACpDC;AACX,CAAC,UAAU,kBAAkB,EAAE;AAC/B,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,SAAS;AAC3C,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,SAAS;AAC3C,IAAI,kBAAkB,CAAC,aAAa,CAAC,GAAG,aAAa;AACrD,CAAC,EAAEA,0BAAkB,KAAKA,0BAAkB,GAAG,EAAE,CAAC,CAAC;;ACT9C,MAAC,aAAa,GAAGC,mBAAc,CAAC,eAAe,EAAE;AACtD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;AACpE,CAAC;;ACDM,MAAM,gBAAgB,SAASC,cAAS,CAAC;AAChD,IAAI,MAAM,qBAAqB,CAAC,OAAO,EAAE;AACzC,QAAQ,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,OAAO,CAAC;AACnE,QAAQ;AACR;AACA,IAAI,MAAM,qBAAqB,GAAG;AAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC;AAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAEH,gCAAwB,CAAC,IAAI,EAAE;AAC/E;AACA;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -1,6 +1,18 @@
1
1
  var NavigationBarPlugin = (function (exports, core) {
2
2
  'use strict';
3
3
 
4
+ exports.NavigationBarButtonStyle = void 0;
5
+ (function (NavigationBarButtonStyle) {
6
+ NavigationBarButtonStyle["LIGHT"] = "#FFFFFF";
7
+ NavigationBarButtonStyle["DARK"] = "#000000";
8
+ })(exports.NavigationBarButtonStyle || (exports.NavigationBarButtonStyle = {}));
9
+ exports.NavigationBarColor = void 0;
10
+ (function (NavigationBarColor) {
11
+ NavigationBarColor["WHITE"] = "#FFFFFF";
12
+ NavigationBarColor["BLACK"] = "#000000";
13
+ NavigationBarColor["TRANSPARENT"] = "transparent";
14
+ })(exports.NavigationBarColor || (exports.NavigationBarColor = {}));
15
+
4
16
  const NavigationBar = core.registerPlugin("NavigationBar", {
5
17
  web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.NavigationBarWeb()),
6
18
  });
@@ -12,7 +24,7 @@ var NavigationBarPlugin = (function (exports, core) {
12
24
  }
13
25
  async getNavigationBarColor() {
14
26
  console.log("Cannot getNavigationBarColor on web");
15
- return { color: "#000000" };
27
+ return { color: "#000000", buttonStyle: exports.NavigationBarButtonStyle.DARK };
16
28
  }
17
29
  }
18
30
 
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nconst NavigationBar = registerPlugin(\"NavigationBar\", {\n web: () => import(\"./web\").then((m) => new m.NavigationBarWeb()),\n});\nexport * from \"./definitions\";\nexport { NavigationBar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport class NavigationBarWeb extends WebPlugin {\n async setNavigationBarColor(options) {\n console.log(\"Cannot setNavigationBarColor on web\", options);\n return;\n }\n async getNavigationBarColor() {\n console.log(\"Cannot getNavigationBarColor on web\");\n return { color: \"#000000\" };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,aAAa,GAAGA,mBAAc,CAAC,eAAe,EAAE;IACtD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpE,CAAC;;ICFM,MAAM,gBAAgB,SAASC,cAAS,CAAC;IAChD,IAAI,MAAM,qBAAqB,CAAC,OAAO,EAAE;IACzC,QAAQ,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,OAAO,CAAC;IACnE,QAAQ;IACR;IACA,IAAI,MAAM,qBAAqB,GAAG;IAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC;IAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE;IACnC;IACA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var NavigationBarButtonStyle;\n(function (NavigationBarButtonStyle) {\n NavigationBarButtonStyle[\"LIGHT\"] = \"#FFFFFF\";\n NavigationBarButtonStyle[\"DARK\"] = \"#000000\";\n})(NavigationBarButtonStyle || (NavigationBarButtonStyle = {}));\nexport var NavigationBarColor;\n(function (NavigationBarColor) {\n NavigationBarColor[\"WHITE\"] = \"#FFFFFF\";\n NavigationBarColor[\"BLACK\"] = \"#000000\";\n NavigationBarColor[\"TRANSPARENT\"] = \"transparent\";\n})(NavigationBarColor || (NavigationBarColor = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst NavigationBar = registerPlugin(\"NavigationBar\", {\n web: () => import(\"./web\").then((m) => new m.NavigationBarWeb()),\n});\nexport * from \"./definitions\";\nexport { NavigationBar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nimport { NavigationBarButtonStyle } from \"./definitions\";\nexport class NavigationBarWeb extends WebPlugin {\n async setNavigationBarColor(options) {\n console.log(\"Cannot setNavigationBarColor on web\", options);\n return;\n }\n async getNavigationBarColor() {\n console.log(\"Cannot getNavigationBarColor on web\");\n return { color: \"#000000\", buttonStyle: NavigationBarButtonStyle.DARK };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["NavigationBarButtonStyle","NavigationBarColor","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,wBAAwB,EAAE;IACrC,IAAI,wBAAwB,CAAC,OAAO,CAAC,GAAG,SAAS;IACjD,IAAI,wBAAwB,CAAC,MAAM,CAAC,GAAG,SAAS;IAChD,CAAC,EAAEA,gCAAwB,KAAKA,gCAAwB,GAAG,EAAE,CAAC,CAAC;AACpDC;IACX,CAAC,UAAU,kBAAkB,EAAE;IAC/B,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,SAAS;IAC3C,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,SAAS;IAC3C,IAAI,kBAAkB,CAAC,aAAa,CAAC,GAAG,aAAa;IACrD,CAAC,EAAEA,0BAAkB,KAAKA,0BAAkB,GAAG,EAAE,CAAC,CAAC;;ACT9C,UAAC,aAAa,GAAGC,mBAAc,CAAC,eAAe,EAAE;IACtD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpE,CAAC;;ICDM,MAAM,gBAAgB,SAASC,cAAS,CAAC;IAChD,IAAI,MAAM,qBAAqB,CAAC,OAAO,EAAE;IACzC,QAAQ,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,OAAO,CAAC;IACnE,QAAQ;IACR;IACA,IAAI,MAAM,qBAAqB,GAAG;IAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC;IAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAEH,gCAAwB,CAAC,IAAI,EAAE;IAC/E;IACA;;;;;;;;;;;;;;;"}
@@ -11,7 +11,7 @@ public class NavigationBarPlugin: CAPPlugin, CAPBridgedPlugin {
11
11
  public let jsName = "NavigationBar"
12
12
  public let pluginMethods: [CAPPluginMethod] = [
13
13
  CAPPluginMethod(name: "setNavigationBarColor", returnType: CAPPluginReturnPromise),
14
- CAPPluginMethod(name: "getNavigationBarColor", returnType: CAPPluginReturnPromise),
14
+ CAPPluginMethod(name: "getNavigationBarColor", returnType: CAPPluginReturnPromise)
15
15
  ]
16
16
  @objc func setNavigationBarColor(_ call: CAPPluginCall) {
17
17
  let color = call.getString("color") ?? ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-navigation-bar",
3
- "version": "7.1.2",
3
+ "version": "7.1.8",
4
4
  "description": "Set navigation bar color for android lolipop and higher",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",