Explorar el Código

fix: invoke setTitleBarColor directly from window.appBridge

Acathur hace 4 años
padre
commit
a4a1131367
Se han modificado 3 ficheros con 8 adiciones y 3 borrados
  1. 4 1
      dist/bridge/index.js
  2. 1 1
      package.json
  3. 3 1
      src/bridge/index.ts

+ 4 - 1
dist/bridge/index.js

@@ -251,7 +251,10 @@ class ProginnBridge {
     }
     // ui
     setNavigationBarColor(hex) {
-        if (this.isAndroid || this.compareAppVersion('lt', '4.22.0')) {
+        if (this.isAndroid) {
+            window.appBridge.setTitleBarColor(hex);
+        }
+        else if (this.compareAppVersion('lt', '4.22.0')) {
             this.invoke('setTitleBarColor', hex);
         }
         else {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "proginn-lib",
-  "version": "0.4.2",
+  "version": "0.4.3",
   "description": "Proginn front-end common library.",
   "main": "dist/index.js",
   "module": "dist/index.js",

+ 3 - 1
src/bridge/index.ts

@@ -308,7 +308,9 @@ class ProginnBridge {
 
   // ui
   setNavigationBarColor(hex: string) {
-    if (this.isAndroid || this.compareAppVersion('lt', '4.22.0')) {
+    if (this.isAndroid) {
+      window.appBridge.setTitleBarColor(hex)
+    } else if (this.compareAppVersion('lt', '4.22.0')) {
       this.invoke('setTitleBarColor', hex)
     } else {
       this.invoke('setNavigationBarColor', hex)