capacitor-plugin-status-bar 2.0.2 → 2.0.4
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/Package.swift +6 -6
- package/android/src/main/java/com/cap/plugins/statusbar/{StatusBar.java → CapacitorStatusBar.java} +119 -126
- package/android/src/main/java/com/cap/plugins/statusbar/{StatusBarPlugin.java → CapacitorStatusBarPlugin.java} +3 -3
- package/dist/docs.json +2 -2
- package/dist/esm/definitions.d.ts +1 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +2 -2
- package/dist/esm/web.js +1 -1
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +5 -5
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +5 -5
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/{StatusBarPlugin/StatusBar.swift → CapacitorStatusBarPlugin/CapacitorStatusBar.swift} +24 -24
- package/ios/Sources/{StatusBarPlugin/StatusBarPlugin.swift → CapacitorStatusBarPlugin/CapacitorStatusBarPlugin.swift} +5 -5
- package/ios/Tests/{StatusBarPluginTests/StatusBarPluginTests.swift → CapacitorStatusBarPluginTests/CapacitorStatusBarPluginTests.swift} +3 -3
- package/package.json +2 -2
package/Package.swift
CHANGED
|
@@ -7,22 +7,22 @@ let package = Package(
|
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "CapacitorPluginStatusBar",
|
|
10
|
-
targets: ["
|
|
10
|
+
targets: ["CapacitorStatusBarPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
13
|
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
|
17
|
-
name: "
|
|
17
|
+
name: "CapacitorStatusBarPlugin",
|
|
18
18
|
dependencies: [
|
|
19
19
|
.product(name: "Capacitor", package: "capacitor-swift-pm"),
|
|
20
20
|
.product(name: "Cordova", package: "capacitor-swift-pm")
|
|
21
21
|
],
|
|
22
|
-
path: "ios/Sources/
|
|
22
|
+
path: "ios/Sources/CapacitorStatusBarPlugin"),
|
|
23
23
|
.testTarget(
|
|
24
|
-
name: "
|
|
25
|
-
dependencies: ["
|
|
26
|
-
path: "ios/Tests/
|
|
24
|
+
name: "CapacitorStatusBarPluginTests",
|
|
25
|
+
dependencies: ["CapacitorStatusBarPlugin"],
|
|
26
|
+
path: "ios/Tests/CapacitorStatusBarPluginTests")
|
|
27
27
|
]
|
|
28
28
|
)
|
package/android/src/main/java/com/cap/plugins/statusbar/{StatusBar.java → CapacitorStatusBar.java}
RENAMED
|
@@ -31,8 +31,8 @@ import com.getcapacitor.Plugin;
|
|
|
31
31
|
* - API 35+ (Android 15+): Fully compatible with edge-to-edge display
|
|
32
32
|
* enforcement
|
|
33
33
|
*/
|
|
34
|
-
public class
|
|
35
|
-
private static final String TAG = "
|
|
34
|
+
public class CapacitorStatusBar extends Plugin {
|
|
35
|
+
private static final String TAG = "CapacitorStatusBar";
|
|
36
36
|
private static final String STATUS_BAR_OVERLAY_TAG = "capacitor_status_bar_overlay";
|
|
37
37
|
private static final String NAV_BAR_OVERLAY_TAG = "capacitor_navigation_bar_overlay";
|
|
38
38
|
|
|
@@ -42,61 +42,72 @@ public class StatusBar extends Plugin {
|
|
|
42
42
|
private int currentStatusBarColor = Color.BLACK;
|
|
43
43
|
private int currentNavBarColor = Color.BLACK;
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
setupEdgeToEdgeBehavior();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
private void setupEdgeToEdgeBehavior() {
|
|
52
|
-
Activity activity = getActivity();
|
|
53
|
-
if (activity == null)
|
|
54
|
-
return;
|
|
55
|
-
|
|
56
|
-
Window window = activity.getWindow();
|
|
57
|
-
View decorView = window.getDecorView();
|
|
58
|
-
|
|
59
|
-
WindowCompat.setDecorFitsSystemWindows(window, false);
|
|
60
|
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { // Android 14+
|
|
61
|
-
ViewCompat.setOnApplyWindowInsetsListener(decorView, (v, insets) -> {
|
|
62
|
-
ViewCompat.onApplyWindowInsets(v, insets);
|
|
63
|
-
return insets;
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
45
|
+
// Note: load() is not called since CapacitorStatusBar is instantiated via new CapacitorStatusBar()
|
|
46
|
+
// from CapacitorStatusBarPlugin, not registered as a Capacitor plugin itself.
|
|
47
|
+
// All initialization happens via ensureEdgeToEdgeConfigured() called from CapacitorStatusBarPlugin.load().
|
|
67
48
|
|
|
68
49
|
/**
|
|
69
50
|
* Ensures edge-to-edge is properly configured for Android 15+.
|
|
70
|
-
*
|
|
71
|
-
*
|
|
51
|
+
* Sets up a unified insets listener on the decorView that handles both
|
|
52
|
+
* IME insets and overlay view sizing.
|
|
72
53
|
*
|
|
73
54
|
* @param activity The activity to configure
|
|
74
55
|
*/
|
|
75
56
|
public void ensureEdgeToEdgeConfigured(Activity activity) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
View decorView = window.getDecorView();
|
|
57
|
+
Window window = activity.getWindow();
|
|
58
|
+
View decorView = window.getDecorView();
|
|
79
59
|
|
|
80
|
-
|
|
60
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
|
61
|
+
// Android 15+ (API 35+): Full edge-to-edge with overlay views
|
|
81
62
|
WindowCompat.setDecorFitsSystemWindows(window, false);
|
|
82
63
|
|
|
64
|
+
// Make native bar colors transparent so our overlays are the sole color source
|
|
65
|
+
window.setStatusBarColor(Color.TRANSPARENT);
|
|
66
|
+
window.setNavigationBarColor(Color.TRANSPARENT);
|
|
67
|
+
window.setStatusBarContrastEnforced(false);
|
|
68
|
+
window.setNavigationBarContrastEnforced(false);
|
|
69
|
+
|
|
70
|
+
// Single unified insets listener on decorView for overlay sizing
|
|
83
71
|
ViewCompat.setOnApplyWindowInsetsListener(decorView, (v, insets) -> {
|
|
84
|
-
|
|
85
|
-
|
|
72
|
+
// Size status bar overlay
|
|
73
|
+
int top = insets.getInsets(WindowInsetsCompat.Type.statusBars()).top;
|
|
74
|
+
View statusOverlay = ((ViewGroup) v).findViewWithTag(STATUS_BAR_OVERLAY_TAG);
|
|
75
|
+
if (statusOverlay != null) {
|
|
76
|
+
ViewGroup.LayoutParams params = statusOverlay.getLayoutParams();
|
|
77
|
+
if (params.height != top) {
|
|
78
|
+
params.height = top;
|
|
79
|
+
statusOverlay.setLayoutParams(params);
|
|
80
|
+
Log.d(TAG, "insetsListener: status bar overlay height=" + top);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
86
83
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
// Size navigation bar overlay
|
|
85
|
+
int bottom = insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom;
|
|
86
|
+
View navOverlay = ((ViewGroup) v).findViewWithTag(NAV_BAR_OVERLAY_TAG);
|
|
87
|
+
if (navOverlay != null) {
|
|
88
|
+
ViewGroup.LayoutParams params = navOverlay.getLayoutParams();
|
|
89
|
+
if (params.height != bottom) {
|
|
90
|
+
params.height = bottom;
|
|
91
|
+
navOverlay.setLayoutParams(params);
|
|
92
|
+
Log.d(TAG, "insetsListener: nav bar overlay height=" + bottom);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
91
95
|
|
|
92
96
|
ViewCompat.onApplyWindowInsets(v, insets);
|
|
93
97
|
return insets;
|
|
94
98
|
});
|
|
95
99
|
|
|
96
|
-
Log.d(TAG,
|
|
97
|
-
"ensureEdgeToEdgeConfigured: Edge-to-edge enabled with WindowInsets API for Android 15+ (API 35+)");
|
|
100
|
+
Log.d(TAG, "ensureEdgeToEdgeConfigured: edge-to-edge with overlay views, API=" + Build.VERSION.SDK_INT);
|
|
98
101
|
} else {
|
|
99
|
-
|
|
102
|
+
// Android < 15: Only disable contrast enforcement.
|
|
103
|
+
// Do NOT call setDecorFitsSystemWindows(false), create overlay views, or set insets listener.
|
|
104
|
+
// This avoids conflicts with plugins like @capawesome/capacitor-android-edge-to-edge-support.
|
|
105
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
|
106
|
+
window.setStatusBarContrastEnforced(false);
|
|
107
|
+
window.setNavigationBarContrastEnforced(false);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
Log.d(TAG, "ensureEdgeToEdgeConfigured: contrast enforcement disabled only, API=" + Build.VERSION.SDK_INT);
|
|
100
111
|
}
|
|
101
112
|
}
|
|
102
113
|
|
|
@@ -195,11 +206,6 @@ public class StatusBar extends Plugin {
|
|
|
195
206
|
Log.d(TAG, "setStyle: style=" + style + ", colorHex=" + colorHex);
|
|
196
207
|
Window window = activity.getWindow();
|
|
197
208
|
|
|
198
|
-
// Enable drawing of system bar backgrounds (required for color changes)
|
|
199
|
-
window.addFlags(android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
|
200
|
-
window.clearFlags(android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
|
201
|
-
window.clearFlags(android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
|
202
|
-
|
|
203
209
|
// Store the current style and color for later reapplication
|
|
204
210
|
currentStyle = style;
|
|
205
211
|
currentColorHex = colorHex;
|
|
@@ -384,69 +390,63 @@ public class StatusBar extends Plugin {
|
|
|
384
390
|
|
|
385
391
|
private void applyStatusBarBackground(Activity activity, @ColorInt int color) {
|
|
386
392
|
Log.d(TAG, "applyStatusBarBackground: color=#" + Integer.toHexString(color) + ", API=" + Build.VERSION.SDK_INT);
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
393
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
|
394
|
+
// Android 15+: Use overlay views
|
|
395
|
+
ensureStatusBarOverlay(activity, color);
|
|
396
|
+
} else {
|
|
397
|
+
// Android < 15: Use native window API directly
|
|
398
|
+
activity.getWindow().setStatusBarColor(color);
|
|
399
|
+
}
|
|
390
400
|
}
|
|
391
401
|
|
|
392
402
|
private void applyNavigationBarBackground(Activity activity, @ColorInt int color) {
|
|
393
403
|
Log.d(TAG, "applyNavigationBarBackground: color=#" + Integer.toHexString(color) + ", API="
|
|
394
404
|
+ Build.VERSION.SDK_INT);
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
405
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
|
406
|
+
// Android 15+: Use overlay views
|
|
407
|
+
ensureNavBarOverlay(activity, color);
|
|
408
|
+
} else {
|
|
409
|
+
// Android < 15: Use native window API directly
|
|
410
|
+
activity.getWindow().setNavigationBarColor(color);
|
|
411
|
+
}
|
|
398
412
|
}
|
|
399
413
|
|
|
400
414
|
private void ensureStatusBarOverlay(Activity activity, @ColorInt int color) {
|
|
401
415
|
Log.d(TAG, "ensureStatusBarOverlay: color=#" + Integer.toHexString(color));
|
|
402
416
|
ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
|
|
403
417
|
View existing = decorView.findViewWithTag(STATUS_BAR_OVERLAY_TAG);
|
|
418
|
+
|
|
419
|
+
// Get current status bar height synchronously for immediate sizing
|
|
420
|
+
int initialHeight = 0;
|
|
421
|
+
WindowInsetsCompat rootInsets = ViewCompat.getRootWindowInsets(decorView);
|
|
422
|
+
if (rootInsets != null) {
|
|
423
|
+
initialHeight = rootInsets.getInsets(WindowInsetsCompat.Type.statusBars()).top;
|
|
424
|
+
}
|
|
425
|
+
|
|
404
426
|
if (existing == null) {
|
|
405
|
-
Log.d(TAG, "ensureStatusBarOverlay: creating new overlay");
|
|
427
|
+
Log.d(TAG, "ensureStatusBarOverlay: creating new overlay, initialHeight=" + initialHeight);
|
|
406
428
|
View overlay = new View(activity);
|
|
407
429
|
overlay.setTag(STATUS_BAR_OVERLAY_TAG);
|
|
408
430
|
overlay.setBackgroundColor(color);
|
|
409
431
|
|
|
410
432
|
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
|
|
411
433
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
412
|
-
|
|
413
|
-
lp.topMargin = 0;
|
|
434
|
+
initialHeight);
|
|
414
435
|
overlay.setLayoutParams(lp);
|
|
415
436
|
|
|
416
|
-
// Add to the top of the decor view
|
|
417
437
|
decorView.addView(overlay);
|
|
418
|
-
|
|
419
|
-
// Listen on decorView for reliable insets dispatch across all API levels,
|
|
420
|
-
// then use WindowInsetsCompat.Type.statusBars() for accurate status-bar-only height
|
|
421
|
-
ViewCompat.setOnApplyWindowInsetsListener(decorView, (v, windowInsets) -> {
|
|
422
|
-
int top = windowInsets.getInsets(WindowInsetsCompat.Type.statusBars()).top;
|
|
423
|
-
View statusOverlay = decorView.findViewWithTag(STATUS_BAR_OVERLAY_TAG);
|
|
424
|
-
if (statusOverlay != null) {
|
|
425
|
-
ViewGroup.LayoutParams params = statusOverlay.getLayoutParams();
|
|
426
|
-
if (params.height != top) {
|
|
427
|
-
params.height = top;
|
|
428
|
-
statusOverlay.setLayoutParams(params);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom;
|
|
433
|
-
View navOverlay = decorView.findViewWithTag(NAV_BAR_OVERLAY_TAG);
|
|
434
|
-
if (navOverlay != null) {
|
|
435
|
-
ViewGroup.LayoutParams params = navOverlay.getLayoutParams();
|
|
436
|
-
if (params.height != bottom) {
|
|
437
|
-
params.height = bottom;
|
|
438
|
-
navOverlay.setLayoutParams(params);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
ViewCompat.onApplyWindowInsets(v, windowInsets);
|
|
443
|
-
return windowInsets;
|
|
444
|
-
});
|
|
438
|
+
// Sizing updates are handled by the unified listener in ensureEdgeToEdgeConfigured
|
|
445
439
|
decorView.requestApplyInsets();
|
|
446
440
|
} else {
|
|
447
441
|
Log.d(TAG, "ensureStatusBarOverlay: updating existing overlay");
|
|
448
442
|
existing.setBackgroundColor(color);
|
|
449
|
-
|
|
443
|
+
// Update height if it was 0 (listener hadn't fired yet)
|
|
444
|
+
ViewGroup.LayoutParams params = existing.getLayoutParams();
|
|
445
|
+
if (params.height == 0 && initialHeight > 0) {
|
|
446
|
+
params.height = initialHeight;
|
|
447
|
+
existing.setLayoutParams(params);
|
|
448
|
+
Log.d(TAG, "ensureStatusBarOverlay: fixed height to " + initialHeight);
|
|
449
|
+
}
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
|
|
@@ -464,53 +464,39 @@ public class StatusBar extends Plugin {
|
|
|
464
464
|
Log.d(TAG, "ensureNavBarOverlay: color=#" + Integer.toHexString(color));
|
|
465
465
|
ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
|
|
466
466
|
View existing = decorView.findViewWithTag(NAV_BAR_OVERLAY_TAG);
|
|
467
|
+
|
|
468
|
+
// Get current nav bar height synchronously for immediate sizing
|
|
469
|
+
int initialHeight = 0;
|
|
470
|
+
WindowInsetsCompat rootInsets = ViewCompat.getRootWindowInsets(decorView);
|
|
471
|
+
if (rootInsets != null) {
|
|
472
|
+
initialHeight = rootInsets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom;
|
|
473
|
+
}
|
|
474
|
+
|
|
467
475
|
if (existing == null) {
|
|
468
|
-
Log.d(TAG, "ensureNavBarOverlay: creating new overlay");
|
|
476
|
+
Log.d(TAG, "ensureNavBarOverlay: creating new overlay, initialHeight=" + initialHeight);
|
|
469
477
|
View overlay = new View(activity);
|
|
470
478
|
overlay.setTag(NAV_BAR_OVERLAY_TAG);
|
|
471
479
|
overlay.setBackgroundColor(color);
|
|
472
480
|
|
|
473
481
|
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
|
|
474
482
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
475
|
-
|
|
483
|
+
initialHeight);
|
|
476
484
|
lp.gravity = Gravity.BOTTOM;
|
|
477
485
|
overlay.setLayoutParams(lp);
|
|
478
486
|
|
|
479
487
|
decorView.addView(overlay);
|
|
480
|
-
|
|
481
|
-
// Insets sizing is handled by the shared decorView listener in ensureStatusBarOverlay.
|
|
482
|
-
// If status bar overlay was not created yet, set up the listener here.
|
|
483
|
-
if (decorView.findViewWithTag(STATUS_BAR_OVERLAY_TAG) == null) {
|
|
484
|
-
ViewCompat.setOnApplyWindowInsetsListener(decorView, (v, windowInsets) -> {
|
|
485
|
-
int top = windowInsets.getInsets(WindowInsetsCompat.Type.statusBars()).top;
|
|
486
|
-
View statusOverlay = decorView.findViewWithTag(STATUS_BAR_OVERLAY_TAG);
|
|
487
|
-
if (statusOverlay != null) {
|
|
488
|
-
ViewGroup.LayoutParams params = statusOverlay.getLayoutParams();
|
|
489
|
-
if (params.height != top) {
|
|
490
|
-
params.height = top;
|
|
491
|
-
statusOverlay.setLayoutParams(params);
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom;
|
|
496
|
-
View navOverlay = decorView.findViewWithTag(NAV_BAR_OVERLAY_TAG);
|
|
497
|
-
if (navOverlay != null) {
|
|
498
|
-
ViewGroup.LayoutParams params = navOverlay.getLayoutParams();
|
|
499
|
-
if (params.height != bottom) {
|
|
500
|
-
params.height = bottom;
|
|
501
|
-
navOverlay.setLayoutParams(params);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
ViewCompat.onApplyWindowInsets(v, windowInsets);
|
|
506
|
-
return windowInsets;
|
|
507
|
-
});
|
|
508
|
-
}
|
|
488
|
+
// Sizing updates are handled by the unified listener in ensureEdgeToEdgeConfigured
|
|
509
489
|
decorView.requestApplyInsets();
|
|
510
490
|
} else {
|
|
511
491
|
Log.d(TAG, "ensureNavBarOverlay: updating existing overlay");
|
|
512
492
|
existing.setBackgroundColor(color);
|
|
513
|
-
|
|
493
|
+
// Update height if it was 0 (listener hadn't fired yet)
|
|
494
|
+
ViewGroup.LayoutParams params = existing.getLayoutParams();
|
|
495
|
+
if (params.height == 0 && initialHeight > 0) {
|
|
496
|
+
params.height = initialHeight;
|
|
497
|
+
existing.setLayoutParams(params);
|
|
498
|
+
Log.d(TAG, "ensureNavBarOverlay: fixed height to " + initialHeight);
|
|
499
|
+
}
|
|
514
500
|
}
|
|
515
501
|
}
|
|
516
502
|
|
|
@@ -536,21 +522,28 @@ public class StatusBar extends Plugin {
|
|
|
536
522
|
*/
|
|
537
523
|
private void makeStatusBarBackgroundTransparent(Activity activity) {
|
|
538
524
|
Log.d(TAG, "makeStatusBarBackgroundTransparent: API=" + Build.VERSION.SDK_INT);
|
|
539
|
-
Window window = activity.getWindow();
|
|
540
525
|
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
View navBarOverlay = decorView.findViewWithTag(NAV_BAR_OVERLAY_TAG);
|
|
526
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
|
527
|
+
// Android 15+: Set overlay backgrounds to transparent
|
|
528
|
+
ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
|
|
545
529
|
|
|
546
|
-
|
|
547
|
-
statusBarOverlay
|
|
548
|
-
|
|
549
|
-
|
|
530
|
+
View statusBarOverlay = decorView.findViewWithTag(STATUS_BAR_OVERLAY_TAG);
|
|
531
|
+
if (statusBarOverlay != null) {
|
|
532
|
+
statusBarOverlay.setBackgroundColor(Color.TRANSPARENT);
|
|
533
|
+
Log.d(TAG, "makeStatusBarBackgroundTransparent: status bar overlay made transparent");
|
|
534
|
+
}
|
|
550
535
|
|
|
551
|
-
|
|
552
|
-
navBarOverlay
|
|
553
|
-
|
|
536
|
+
View navBarOverlay = decorView.findViewWithTag(NAV_BAR_OVERLAY_TAG);
|
|
537
|
+
if (navBarOverlay != null) {
|
|
538
|
+
navBarOverlay.setBackgroundColor(Color.TRANSPARENT);
|
|
539
|
+
Log.d(TAG, "makeStatusBarBackgroundTransparent: navigation bar overlay made transparent");
|
|
540
|
+
}
|
|
541
|
+
} else {
|
|
542
|
+
// Android < 15: Use native window API directly
|
|
543
|
+
Window window = activity.getWindow();
|
|
544
|
+
window.setStatusBarColor(Color.TRANSPARENT);
|
|
545
|
+
window.setNavigationBarColor(Color.TRANSPARENT);
|
|
546
|
+
Log.d(TAG, "makeStatusBarBackgroundTransparent: set native bar colors to transparent");
|
|
554
547
|
}
|
|
555
548
|
}
|
|
556
549
|
|
|
@@ -5,9 +5,9 @@ import com.getcapacitor.PluginCall;
|
|
|
5
5
|
import com.getcapacitor.PluginMethod;
|
|
6
6
|
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
7
7
|
|
|
8
|
-
@CapacitorPlugin(name = "
|
|
9
|
-
public class
|
|
10
|
-
private final
|
|
8
|
+
@CapacitorPlugin(name = "CapacitorStatusBar")
|
|
9
|
+
public class CapacitorStatusBarPlugin extends Plugin {
|
|
10
|
+
private final CapacitorStatusBar implementation = new CapacitorStatusBar();
|
|
11
11
|
|
|
12
12
|
@Override
|
|
13
13
|
public void load() {
|
package/dist/docs.json
CHANGED
|
@@ -47,7 +47,7 @@ export declare type SafeAreaInsets = {
|
|
|
47
47
|
left: number;
|
|
48
48
|
right: number;
|
|
49
49
|
};
|
|
50
|
-
export interface
|
|
50
|
+
export interface CapacitorStatusBarPlugin {
|
|
51
51
|
/**
|
|
52
52
|
* Set the status bar and navigation bar style and color.
|
|
53
53
|
* @param options - The options to set the status bar style and color.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,KAIX;AAJD,WAAY,KAAK;IACf,wBAAe,CAAA;IACf,sBAAa,CAAA;IACb,0BAAiB,CAAA;AACnB,CAAC,EAJW,KAAK,KAAL,KAAK,QAIhB;AAWD,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,qCAAe,CAAA;AACjB,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["export enum Style {\n LIGHT = 'LIGHT',\n DARK = 'DARK',\n CUSTOM = 'CUSTOM',\n}\n\n/**\n * Full HEX color format only (6 or 8 digits).\n * - 6 digits: #RRGGBB (e.g., #FFFFFF, #000000, #FF5733)\n * - 8 digits: #RRGGBBAA with alpha channel (e.g., #FFFFFF00, #FF5733CC)\n *\n * Note: Short 3-digit format (#FFF) is NOT supported.\n */\nexport type StatusBarColor = `#${string}`;\n\nexport enum StatusBarAnimation {\n NONE = 'none',\n FADE = 'fade',\n SLIDE = 'slide',\n}\n\ntype StatusBarStyleNoDefaultOptions = {\n style: Style;\n};\n\ntype StatusBarStyleOptions =\n | StatusBarStyleNoDefaultOptions\n | {\n style: Style.CUSTOM;\n color: StatusBarColor;\n };\n\nexport type StatusBarOptions = StatusBarStyleOptions;\n\nexport type StatusBarShowOptions = {\n animated: boolean;\n};\n\nexport type StatusBarHideOptions = {\n /**\n * The animation type for hiding the status bar.\n * - 'fade': Makes the background transparent without removing the status bar and navigation bar.\n * - 'slide': Hides the status bar and navigation bar completely (default behavior).\n */\n animation: StatusBarAnimation;\n};\n\nexport type StatusBarSetOverlaysWebViewOptions = {\n value: boolean;\n};\n\nexport type StatusBarSetBackgroundOptions = {\n color: StatusBarColor;\n};\n\nexport type SafeAreaInsets = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n};\n\nexport interface
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,KAIX;AAJD,WAAY,KAAK;IACf,wBAAe,CAAA;IACf,sBAAa,CAAA;IACb,0BAAiB,CAAA;AACnB,CAAC,EAJW,KAAK,KAAL,KAAK,QAIhB;AAWD,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,qCAAe,CAAA;AACjB,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["export enum Style {\n LIGHT = 'LIGHT',\n DARK = 'DARK',\n CUSTOM = 'CUSTOM',\n}\n\n/**\n * Full HEX color format only (6 or 8 digits).\n * - 6 digits: #RRGGBB (e.g., #FFFFFF, #000000, #FF5733)\n * - 8 digits: #RRGGBBAA with alpha channel (e.g., #FFFFFF00, #FF5733CC)\n *\n * Note: Short 3-digit format (#FFF) is NOT supported.\n */\nexport type StatusBarColor = `#${string}`;\n\nexport enum StatusBarAnimation {\n NONE = 'none',\n FADE = 'fade',\n SLIDE = 'slide',\n}\n\ntype StatusBarStyleNoDefaultOptions = {\n style: Style;\n};\n\ntype StatusBarStyleOptions =\n | StatusBarStyleNoDefaultOptions\n | {\n style: Style.CUSTOM;\n color: StatusBarColor;\n };\n\nexport type StatusBarOptions = StatusBarStyleOptions;\n\nexport type StatusBarShowOptions = {\n animated: boolean;\n};\n\nexport type StatusBarHideOptions = {\n /**\n * The animation type for hiding the status bar.\n * - 'fade': Makes the background transparent without removing the status bar and navigation bar.\n * - 'slide': Hides the status bar and navigation bar completely (default behavior).\n */\n animation: StatusBarAnimation;\n};\n\nexport type StatusBarSetOverlaysWebViewOptions = {\n value: boolean;\n};\n\nexport type StatusBarSetBackgroundOptions = {\n color: StatusBarColor;\n};\n\nexport type SafeAreaInsets = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n};\n\nexport interface CapacitorStatusBarPlugin {\n /**\n * Set the status bar and navigation bar style and color.\n * @param options - The options to set the status bar style and color.\n * @param options.style - The style of the status bar.\n * @param options.color - The color of the status bar.\n */\n setStyle(options: StatusBarOptions): Promise<void>;\n /**\n * Show the status bar.\n * @param options - The options to show the status bar.\n * @param options.animated - Whether to animate the status bar.\n */\n show(options: StatusBarShowOptions): Promise<void>;\n /**\n * Hide the status bar.\n * @param options - The options to hide the status bar.\n * @param options.animation - The animation type: 'fade' makes background transparent, 'slide' hides bars completely.\n */\n hide(options: StatusBarHideOptions): Promise<void>;\n /**\n * Set whether the status bar overlays the web view.\n *\n * **iOS only** - On Android this is a no-op (resolves without error).\n *\n * - `true`: Web content extends behind the status bar (transparent background),\n * allowing content to be visible through the status bar area on scroll.\n * - `false`: Restores the status bar background to the color set by `setStyle`\n * or falls back to the default style from Capacitor config.\n *\n * @param options - The options to set the status bar overlays web view.\n * @param options.value - Whether the status bar overlays the web view (required).\n */\n setOverlaysWebView(options: StatusBarSetOverlaysWebViewOptions): Promise<void>;\n /**\n * Set the window background color.\n * @param options - The options to set the window background color.\n * @param options.color - The background color in HEX format.\n */\n setBackground(options: StatusBarSetBackgroundOptions): Promise<void>;\n /**\n * Get the safe area insets.\n * Returns the insets for status bar, navigation bar, and notch areas.\n * Values are in CSS pixels (dp) on all platforms.\n */\n getSafeAreaInsets(): Promise<SafeAreaInsets>;\n}\n"]}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const
|
|
1
|
+
import type { CapacitorStatusBarPlugin } from './definitions';
|
|
2
|
+
declare const CapacitorStatusBar: CapacitorStatusBarPlugin;
|
|
3
3
|
export * from './definitions';
|
|
4
|
-
export {
|
|
4
|
+
export { CapacitorStatusBar };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { registerPlugin } from '@capacitor/core';
|
|
2
|
-
const
|
|
3
|
-
web: () => import('./web').then((m) => new m.
|
|
2
|
+
const CapacitorStatusBar = registerPlugin('CapacitorStatusBar', {
|
|
3
|
+
web: () => import('./web').then((m) => new m.CapacitorStatusBarWeb()),
|
|
4
4
|
});
|
|
5
5
|
export * from './definitions';
|
|
6
|
-
export {
|
|
6
|
+
export { CapacitorStatusBar };
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,kBAAkB,GAAG,cAAc,CAA2B,oBAAoB,EAAE;IACxF,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;CACtE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { CapacitorStatusBarPlugin } from './definitions';\n\nconst CapacitorStatusBar = registerPlugin<CapacitorStatusBarPlugin>('CapacitorStatusBar', {\n web: () => import('./web').then((m) => new m.CapacitorStatusBarWeb()),\n});\n\nexport * from './definitions';\nexport { CapacitorStatusBar };\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type { StatusBarOptions,
|
|
3
|
-
export declare class
|
|
2
|
+
import type { StatusBarOptions, CapacitorStatusBarPlugin, StatusBarSetOverlaysWebViewOptions, StatusBarShowOptions, StatusBarHideOptions, StatusBarSetBackgroundOptions, SafeAreaInsets } from './definitions';
|
|
3
|
+
export declare class CapacitorStatusBarWeb extends WebPlugin implements CapacitorStatusBarPlugin {
|
|
4
4
|
setStyle(options: StatusBarOptions): Promise<void>;
|
|
5
5
|
show(options: StatusBarShowOptions): Promise<void>;
|
|
6
6
|
hide(options: StatusBarHideOptions): Promise<void>;
|
package/dist/esm/web.js
CHANGED
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAY5C,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAY5C,MAAM,OAAO,qBAAsB,SAAQ,SAAS;IAClD,KAAK,CAAC,QAAQ,CAAC,OAAyB;QACtC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAA6B;QACtC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAA6B;QACtC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,OAA2C;QAClE,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAAsC;QACxD,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,uEAAuE;QACvE,6DAA6D;QAC7D,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAU,EAAE;YACjD,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;YAC3F,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC;QAEF,MAAM,MAAM,GAAmB;YAC7B,GAAG,EAAE,aAAa,CAAC,0BAA0B,CAAC,IAAI,aAAa,CAAC,+BAA+B,CAAC,IAAI,CAAC;YACrG,MAAM,EAAE,aAAa,CAAC,6BAA6B,CAAC,IAAI,aAAa,CAAC,kCAAkC,CAAC,IAAI,CAAC;YAC9G,IAAI,EAAE,aAAa,CAAC,2BAA2B,CAAC,IAAI,aAAa,CAAC,gCAAgC,CAAC,IAAI,CAAC;YACxG,KAAK,EAAE,aAAa,CAAC,4BAA4B,CAAC,IAAI,aAAa,CAAC,iCAAiC,CAAC,IAAI,CAAC;SAC5G,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n StatusBarOptions,\n CapacitorStatusBarPlugin,\n StatusBarSetOverlaysWebViewOptions,\n StatusBarShowOptions,\n StatusBarHideOptions,\n StatusBarSetBackgroundOptions,\n SafeAreaInsets,\n} from './definitions';\n\nexport class CapacitorStatusBarWeb extends WebPlugin implements CapacitorStatusBarPlugin {\n async setStyle(options: StatusBarOptions): Promise<void> {\n console.log('setStyle', options);\n }\n\n async show(options: StatusBarShowOptions): Promise<void> {\n console.log('show', options);\n }\n\n async hide(options: StatusBarHideOptions): Promise<void> {\n console.log('hide', options);\n }\n\n async setOverlaysWebView(options: StatusBarSetOverlaysWebViewOptions): Promise<void> {\n console.log('setOverlaysWebView', options);\n }\n\n async setBackground(options: StatusBarSetBackgroundOptions): Promise<void> {\n console.log('setBackground', options);\n }\n\n async getSafeAreaInsets(): Promise<SafeAreaInsets> {\n // On web, we can use CSS environment variables to get safe area insets\n // These are set by the browser on devices with notches, etc.\n const getInsetValue = (variable: string): number => {\n const value = getComputedStyle(document.documentElement).getPropertyValue(variable).trim();\n return value ? parseInt(value, 10) : 0;\n };\n\n const insets: SafeAreaInsets = {\n top: getInsetValue('env(safe-area-inset-top)') || getInsetValue('constant(safe-area-inset-top)') || 0,\n bottom: getInsetValue('env(safe-area-inset-bottom)') || getInsetValue('constant(safe-area-inset-bottom)') || 0,\n left: getInsetValue('env(safe-area-inset-left)') || getInsetValue('constant(safe-area-inset-left)') || 0,\n right: getInsetValue('env(safe-area-inset-right)') || getInsetValue('constant(safe-area-inset-right)') || 0,\n };\n\n console.log('getSafeAreaInsets', insets);\n return insets;\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -15,11 +15,11 @@ exports.StatusBarAnimation = void 0;
|
|
|
15
15
|
StatusBarAnimation["SLIDE"] = "slide";
|
|
16
16
|
})(exports.StatusBarAnimation || (exports.StatusBarAnimation = {}));
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.
|
|
18
|
+
const CapacitorStatusBar = core.registerPlugin('CapacitorStatusBar', {
|
|
19
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorStatusBarWeb()),
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
class
|
|
22
|
+
class CapacitorStatusBarWeb extends core.WebPlugin {
|
|
23
23
|
async setStyle(options) {
|
|
24
24
|
console.log('setStyle', options);
|
|
25
25
|
}
|
|
@@ -55,8 +55,8 @@ class StatusBarWeb extends core.WebPlugin {
|
|
|
55
55
|
|
|
56
56
|
var web = /*#__PURE__*/Object.freeze({
|
|
57
57
|
__proto__: null,
|
|
58
|
-
|
|
58
|
+
CapacitorStatusBarWeb: CapacitorStatusBarWeb
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
exports.
|
|
61
|
+
exports.CapacitorStatusBar = CapacitorStatusBar;
|
|
62
62
|
//# sourceMappingURL=plugin.cjs.js.map
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var Style;\n(function (Style) {\n Style[\"LIGHT\"] = \"LIGHT\";\n Style[\"DARK\"] = \"DARK\";\n Style[\"CUSTOM\"] = \"CUSTOM\";\n})(Style || (Style = {}));\nexport var StatusBarAnimation;\n(function (StatusBarAnimation) {\n StatusBarAnimation[\"NONE\"] = \"none\";\n StatusBarAnimation[\"FADE\"] = \"fade\";\n StatusBarAnimation[\"SLIDE\"] = \"slide\";\n})(StatusBarAnimation || (StatusBarAnimation = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var Style;\n(function (Style) {\n Style[\"LIGHT\"] = \"LIGHT\";\n Style[\"DARK\"] = \"DARK\";\n Style[\"CUSTOM\"] = \"CUSTOM\";\n})(Style || (Style = {}));\nexport var StatusBarAnimation;\n(function (StatusBarAnimation) {\n StatusBarAnimation[\"NONE\"] = \"none\";\n StatusBarAnimation[\"FADE\"] = \"fade\";\n StatusBarAnimation[\"SLIDE\"] = \"slide\";\n})(StatusBarAnimation || (StatusBarAnimation = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorStatusBar = registerPlugin('CapacitorStatusBar', {\n web: () => import('./web').then((m) => new m.CapacitorStatusBarWeb()),\n});\nexport * from './definitions';\nexport { CapacitorStatusBar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorStatusBarWeb extends WebPlugin {\n async setStyle(options) {\n console.log('setStyle', options);\n }\n async show(options) {\n console.log('show', options);\n }\n async hide(options) {\n console.log('hide', options);\n }\n async setOverlaysWebView(options) {\n console.log('setOverlaysWebView', options);\n }\n async setBackground(options) {\n console.log('setBackground', options);\n }\n async getSafeAreaInsets() {\n // On web, we can use CSS environment variables to get safe area insets\n // These are set by the browser on devices with notches, etc.\n const getInsetValue = (variable) => {\n const value = getComputedStyle(document.documentElement).getPropertyValue(variable).trim();\n return value ? parseInt(value, 10) : 0;\n };\n const insets = {\n top: getInsetValue('env(safe-area-inset-top)') || getInsetValue('constant(safe-area-inset-top)') || 0,\n bottom: getInsetValue('env(safe-area-inset-bottom)') || getInsetValue('constant(safe-area-inset-bottom)') || 0,\n left: getInsetValue('env(safe-area-inset-left)') || getInsetValue('constant(safe-area-inset-left)') || 0,\n right: getInsetValue('env(safe-area-inset-right)') || getInsetValue('constant(safe-area-inset-right)') || 0,\n };\n console.log('getSafeAreaInsets', insets);\n return insets;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["Style","StatusBarAnimation","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,KAAK,EAAE;AAClB,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO;AAC5B,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;AAC1B,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,QAAQ;AAC9B,CAAC,EAAEA,aAAK,KAAKA,aAAK,GAAG,EAAE,CAAC,CAAC;AACdC;AACX,CAAC,UAAU,kBAAkB,EAAE;AAC/B,IAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG,MAAM;AACvC,IAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG,MAAM;AACvC,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,OAAO;AACzC,CAAC,EAAEA,0BAAkB,KAAKA,0BAAkB,GAAG,EAAE,CAAC,CAAC;;ACV9C,MAAC,kBAAkB,GAAGC,mBAAc,CAAC,oBAAoB,EAAE;AAChE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;AACzE,CAAC;;ACFM,MAAM,qBAAqB,SAASC,cAAS,CAAC;AACrD,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;AAC5B,QAAQ,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC;AACxC,IAAI;AACJ,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;AACpC,IAAI;AACJ,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;AACpC,IAAI;AACJ,IAAI,MAAM,kBAAkB,CAAC,OAAO,EAAE;AACtC,QAAQ,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC;AAClD,IAAI;AACJ,IAAI,MAAM,aAAa,CAAC,OAAO,EAAE;AACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC;AAC7C,IAAI;AACJ,IAAI,MAAM,iBAAiB,GAAG;AAC9B;AACA;AACA,QAAQ,MAAM,aAAa,GAAG,CAAC,QAAQ,KAAK;AAC5C,YAAY,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE;AACtG,YAAY,OAAO,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC;AAClD,QAAQ,CAAC;AACT,QAAQ,MAAM,MAAM,GAAG;AACvB,YAAY,GAAG,EAAE,aAAa,CAAC,0BAA0B,CAAC,IAAI,aAAa,CAAC,+BAA+B,CAAC,IAAI,CAAC;AACjH,YAAY,MAAM,EAAE,aAAa,CAAC,6BAA6B,CAAC,IAAI,aAAa,CAAC,kCAAkC,CAAC,IAAI,CAAC;AAC1H,YAAY,IAAI,EAAE,aAAa,CAAC,2BAA2B,CAAC,IAAI,aAAa,CAAC,gCAAgC,CAAC,IAAI,CAAC;AACpH,YAAY,KAAK,EAAE,aAAa,CAAC,4BAA4B,CAAC,IAAI,aAAa,CAAC,iCAAiC,CAAC,IAAI,CAAC;AACvH,SAAS;AACT,QAAQ,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,MAAM,CAAC;AAChD,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -14,11 +14,11 @@ var capStatusBar = (function (exports, core) {
|
|
|
14
14
|
StatusBarAnimation["SLIDE"] = "slide";
|
|
15
15
|
})(exports.StatusBarAnimation || (exports.StatusBarAnimation = {}));
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.
|
|
17
|
+
const CapacitorStatusBar = core.registerPlugin('CapacitorStatusBar', {
|
|
18
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorStatusBarWeb()),
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
class
|
|
21
|
+
class CapacitorStatusBarWeb extends core.WebPlugin {
|
|
22
22
|
async setStyle(options) {
|
|
23
23
|
console.log('setStyle', options);
|
|
24
24
|
}
|
|
@@ -54,10 +54,10 @@ var capStatusBar = (function (exports, core) {
|
|
|
54
54
|
|
|
55
55
|
var web = /*#__PURE__*/Object.freeze({
|
|
56
56
|
__proto__: null,
|
|
57
|
-
|
|
57
|
+
CapacitorStatusBarWeb: CapacitorStatusBarWeb
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
exports.
|
|
60
|
+
exports.CapacitorStatusBar = CapacitorStatusBar;
|
|
61
61
|
|
|
62
62
|
return exports;
|
|
63
63
|
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var Style;\n(function (Style) {\n Style[\"LIGHT\"] = \"LIGHT\";\n Style[\"DARK\"] = \"DARK\";\n Style[\"CUSTOM\"] = \"CUSTOM\";\n})(Style || (Style = {}));\nexport var StatusBarAnimation;\n(function (StatusBarAnimation) {\n StatusBarAnimation[\"NONE\"] = \"none\";\n StatusBarAnimation[\"FADE\"] = \"fade\";\n StatusBarAnimation[\"SLIDE\"] = \"slide\";\n})(StatusBarAnimation || (StatusBarAnimation = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var Style;\n(function (Style) {\n Style[\"LIGHT\"] = \"LIGHT\";\n Style[\"DARK\"] = \"DARK\";\n Style[\"CUSTOM\"] = \"CUSTOM\";\n})(Style || (Style = {}));\nexport var StatusBarAnimation;\n(function (StatusBarAnimation) {\n StatusBarAnimation[\"NONE\"] = \"none\";\n StatusBarAnimation[\"FADE\"] = \"fade\";\n StatusBarAnimation[\"SLIDE\"] = \"slide\";\n})(StatusBarAnimation || (StatusBarAnimation = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorStatusBar = registerPlugin('CapacitorStatusBar', {\n web: () => import('./web').then((m) => new m.CapacitorStatusBarWeb()),\n});\nexport * from './definitions';\nexport { CapacitorStatusBar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorStatusBarWeb extends WebPlugin {\n async setStyle(options) {\n console.log('setStyle', options);\n }\n async show(options) {\n console.log('show', options);\n }\n async hide(options) {\n console.log('hide', options);\n }\n async setOverlaysWebView(options) {\n console.log('setOverlaysWebView', options);\n }\n async setBackground(options) {\n console.log('setBackground', options);\n }\n async getSafeAreaInsets() {\n // On web, we can use CSS environment variables to get safe area insets\n // These are set by the browser on devices with notches, etc.\n const getInsetValue = (variable) => {\n const value = getComputedStyle(document.documentElement).getPropertyValue(variable).trim();\n return value ? parseInt(value, 10) : 0;\n };\n const insets = {\n top: getInsetValue('env(safe-area-inset-top)') || getInsetValue('constant(safe-area-inset-top)') || 0,\n bottom: getInsetValue('env(safe-area-inset-bottom)') || getInsetValue('constant(safe-area-inset-bottom)') || 0,\n left: getInsetValue('env(safe-area-inset-left)') || getInsetValue('constant(safe-area-inset-left)') || 0,\n right: getInsetValue('env(safe-area-inset-right)') || getInsetValue('constant(safe-area-inset-right)') || 0,\n };\n console.log('getSafeAreaInsets', insets);\n return insets;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["Style","StatusBarAnimation","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,KAAK,EAAE;IAClB,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO;IAC5B,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAC1B,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,QAAQ;IAC9B,CAAC,EAAEA,aAAK,KAAKA,aAAK,GAAG,EAAE,CAAC,CAAC;AACdC;IACX,CAAC,UAAU,kBAAkB,EAAE;IAC/B,IAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG,MAAM;IACvC,IAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG,MAAM;IACvC,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,OAAO;IACzC,CAAC,EAAEA,0BAAkB,KAAKA,0BAAkB,GAAG,EAAE,CAAC,CAAC;;ACV9C,UAAC,kBAAkB,GAAGC,mBAAc,CAAC,oBAAoB,EAAE;IAChE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;IACzE,CAAC;;ICFM,MAAM,qBAAqB,SAASC,cAAS,CAAC;IACrD,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;IAC5B,QAAQ,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC;IACxC,IAAI;IACJ,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACpC,IAAI;IACJ,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACpC,IAAI;IACJ,IAAI,MAAM,kBAAkB,CAAC,OAAO,EAAE;IACtC,QAAQ,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC;IAClD,IAAI;IACJ,IAAI,MAAM,aAAa,CAAC,OAAO,EAAE;IACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC;IAC7C,IAAI;IACJ,IAAI,MAAM,iBAAiB,GAAG;IAC9B;IACA;IACA,QAAQ,MAAM,aAAa,GAAG,CAAC,QAAQ,KAAK;IAC5C,YAAY,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE;IACtG,YAAY,OAAO,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC;IAClD,QAAQ,CAAC;IACT,QAAQ,MAAM,MAAM,GAAG;IACvB,YAAY,GAAG,EAAE,aAAa,CAAC,0BAA0B,CAAC,IAAI,aAAa,CAAC,+BAA+B,CAAC,IAAI,CAAC;IACjH,YAAY,MAAM,EAAE,aAAa,CAAC,6BAA6B,CAAC,IAAI,aAAa,CAAC,kCAAkC,CAAC,IAAI,CAAC;IAC1H,YAAY,IAAI,EAAE,aAAa,CAAC,2BAA2B,CAAC,IAAI,aAAa,CAAC,gCAAgC,CAAC,IAAI,CAAC;IACpH,YAAY,KAAK,EAAE,aAAa,CAAC,4BAA4B,CAAC,IAAI,aAAa,CAAC,iCAAiC,CAAC,IAAI,CAAC;IACvH,SAAS;IACT,QAAQ,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,MAAM,CAAC;IAChD,QAAQ,OAAO,MAAM;IACrB,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import Foundation
|
|
|
2
2
|
import UIKit
|
|
3
3
|
import Capacitor
|
|
4
4
|
|
|
5
|
-
@objc public class
|
|
5
|
+
@objc public class CapacitorStatusBar: NSObject {
|
|
6
6
|
// Tag to identify the status bar background view
|
|
7
7
|
private static let statusBarViewTag = 38482458
|
|
8
8
|
// Store the current background color to restore when showing
|
|
@@ -14,7 +14,7 @@ import Capacitor
|
|
|
14
14
|
DispatchQueue.main.async {
|
|
15
15
|
let isDarkMode = self.isSystemInDarkMode()
|
|
16
16
|
let style = isDarkMode ? "DARK" : "LIGHT"
|
|
17
|
-
print("
|
|
17
|
+
print("CapacitorStatusBar: Applying default style based on system theme - isDarkMode=\(isDarkMode), style=\(style)")
|
|
18
18
|
self.setStyle(style: style, colorHex: nil)
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -64,7 +64,7 @@ import Capacitor
|
|
|
64
64
|
|
|
65
65
|
// Skip background color update when overlays web view is active
|
|
66
66
|
if self.isOverlayMode {
|
|
67
|
-
print("
|
|
67
|
+
print("CapacitorStatusBar: setStyle - overlay mode active, skipping background color")
|
|
68
68
|
} else {
|
|
69
69
|
// Create or update the status bar background view
|
|
70
70
|
self.updateStatusBarBackgroundView(in: window,
|
|
@@ -72,7 +72,7 @@ import Capacitor
|
|
|
72
72
|
color: backgroundColor)
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
print("
|
|
75
|
+
print("CapacitorStatusBar: setStyle - style=\(upperStyle), backgroundColor=\(String(describing: backgroundColor)), statusBarStyle=\(statusBarStyle)")
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -85,7 +85,7 @@ import Capacitor
|
|
|
85
85
|
// Log current status bar state via status bar manager
|
|
86
86
|
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
|
|
87
87
|
let statusBarManager = windowScene.statusBarManager {
|
|
88
|
-
print("
|
|
88
|
+
print("CapacitorStatusBar: show() - Current hidden state: \(statusBarManager.isStatusBarHidden)")
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
// Set visibility using the application-level API
|
|
@@ -104,16 +104,16 @@ import Capacitor
|
|
|
104
104
|
// Log current status bar state via status bar manager
|
|
105
105
|
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
|
|
106
106
|
let statusBarManager = windowScene.statusBarManager {
|
|
107
|
-
print("
|
|
107
|
+
print("CapacitorStatusBar: hide() - animation=\(animationType), Current hidden state: \(statusBarManager.isStatusBarHidden)")
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
if animationType == "fade" {
|
|
111
111
|
// Fade mode: Make background transparent without removing status bar
|
|
112
|
-
print("
|
|
112
|
+
print("CapacitorStatusBar: hide() - fade mode: making background transparent")
|
|
113
113
|
self.makeStatusBarBackgroundTransparent()
|
|
114
114
|
} else if animationType == "slide" {
|
|
115
115
|
// Slide mode: Hide the status bar completely (current behavior)
|
|
116
|
-
print("
|
|
116
|
+
print("CapacitorStatusBar: hide() - slide mode: hiding bars completely")
|
|
117
117
|
// Note: Status bar visibility is controlled through view controllers in modern iOS.
|
|
118
118
|
// This plugin requires UIViewControllerBasedStatusBarAppearance to be set to NO
|
|
119
119
|
// in the app's Info.plist for programmatic show/hide to work.
|
|
@@ -121,7 +121,7 @@ import Capacitor
|
|
|
121
121
|
// Also make the background view transparent when hiding
|
|
122
122
|
self.makeStatusBarBackgroundTransparent()
|
|
123
123
|
} else {
|
|
124
|
-
print("
|
|
124
|
+
print("CapacitorStatusBar: hide() - unknown animation type '\(animationType)', defaulting to slide")
|
|
125
125
|
self.setStatusBarVisibility(hidden: true, animated: true)
|
|
126
126
|
self.makeStatusBarBackgroundTransparent()
|
|
127
127
|
}
|
|
@@ -147,7 +147,7 @@ import Capacitor
|
|
|
147
147
|
/// - color: The background color (nil to remove the view)
|
|
148
148
|
private func updateStatusBarBackgroundView(in window: UIWindow, height: CGFloat, color: UIColor?) {
|
|
149
149
|
// Find existing status bar view
|
|
150
|
-
let existingView = window.viewWithTag(
|
|
150
|
+
let existingView = window.viewWithTag(CapacitorStatusBar.statusBarViewTag)
|
|
151
151
|
|
|
152
152
|
if let color = color {
|
|
153
153
|
// Create or update the status bar background view
|
|
@@ -157,7 +157,7 @@ import Capacitor
|
|
|
157
157
|
statusBarView = existing
|
|
158
158
|
} else {
|
|
159
159
|
statusBarView = UIView(frame: CGRect(x: 0, y: 0, width: window.bounds.width, height: height))
|
|
160
|
-
statusBarView.tag =
|
|
160
|
+
statusBarView.tag = CapacitorStatusBar.statusBarViewTag
|
|
161
161
|
statusBarView.autoresizingMask = [.flexibleWidth]
|
|
162
162
|
window.addSubview(statusBarView)
|
|
163
163
|
}
|
|
@@ -179,7 +179,7 @@ import Capacitor
|
|
|
179
179
|
guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
|
|
180
180
|
let window = windowScene.windows.first,
|
|
181
181
|
let statusBarManager = windowScene.statusBarManager else {
|
|
182
|
-
print("
|
|
182
|
+
print("CapacitorStatusBar: setOverlaysWebView - Unable to get window or status bar manager")
|
|
183
183
|
return
|
|
184
184
|
}
|
|
185
185
|
|
|
@@ -187,20 +187,20 @@ import Capacitor
|
|
|
187
187
|
|
|
188
188
|
if value {
|
|
189
189
|
// Overlay mode: make the status bar background transparent so web content shows through
|
|
190
|
-
let statusBarView = window.viewWithTag(
|
|
190
|
+
let statusBarView = window.viewWithTag(CapacitorStatusBar.statusBarViewTag)
|
|
191
191
|
statusBarView?.backgroundColor = .clear
|
|
192
|
-
print("
|
|
192
|
+
print("CapacitorStatusBar: setOverlaysWebView(true) - content extends behind status bar")
|
|
193
193
|
} else {
|
|
194
194
|
// Non-overlay mode: restore the status bar background from the current style
|
|
195
195
|
if let color = self.currentBackgroundColor {
|
|
196
196
|
self.updateStatusBarBackgroundView(in: window,
|
|
197
197
|
height: statusBarManager.statusBarFrame.height,
|
|
198
198
|
color: color)
|
|
199
|
-
print("
|
|
199
|
+
print("CapacitorStatusBar: setOverlaysWebView(false) - restored background color")
|
|
200
200
|
} else {
|
|
201
201
|
// No style was set; apply default style based on system theme
|
|
202
202
|
self.applyDefaultStyle()
|
|
203
|
-
print("
|
|
203
|
+
print("CapacitorStatusBar: setOverlaysWebView(false) - applied default style from config")
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
}
|
|
@@ -209,18 +209,18 @@ import Capacitor
|
|
|
209
209
|
@objc public func setBackground(colorHex: String?) {
|
|
210
210
|
DispatchQueue.main.async {
|
|
211
211
|
guard let colorHex = colorHex, let color = self.colorFromHex(colorHex) else {
|
|
212
|
-
print("
|
|
212
|
+
print("CapacitorStatusBar: setBackground - Invalid color or nil")
|
|
213
213
|
return
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
|
|
217
217
|
let window = windowScene.windows.first else {
|
|
218
|
-
print("
|
|
218
|
+
print("CapacitorStatusBar: setBackground - Unable to get window")
|
|
219
219
|
return
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
window.backgroundColor = color
|
|
223
|
-
print("
|
|
223
|
+
print("CapacitorStatusBar: setBackground - Set window background to \(colorHex)")
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
@@ -242,9 +242,9 @@ import Capacitor
|
|
|
242
242
|
insets["left"] = safeAreaInsets.left
|
|
243
243
|
insets["right"] = safeAreaInsets.right
|
|
244
244
|
|
|
245
|
-
print("
|
|
245
|
+
print("CapacitorStatusBar: getSafeAreaInsets - top=\(statusBarHeight), bottom=\(safeAreaInsets.bottom), left=\(safeAreaInsets.left), right=\(safeAreaInsets.right)")
|
|
246
246
|
} else {
|
|
247
|
-
print("
|
|
247
|
+
print("CapacitorStatusBar: getSafeAreaInsets - Unable to get window, returning zero insets")
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
completion(insets)
|
|
@@ -255,12 +255,12 @@ import Capacitor
|
|
|
255
255
|
private func makeStatusBarBackgroundTransparent() {
|
|
256
256
|
guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
|
|
257
257
|
let window = windowScene.windows.first,
|
|
258
|
-
let statusBarView = window.viewWithTag(
|
|
258
|
+
let statusBarView = window.viewWithTag(CapacitorStatusBar.statusBarViewTag) else {
|
|
259
259
|
return
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
statusBarView.backgroundColor = .clear
|
|
263
|
-
print("
|
|
263
|
+
print("CapacitorStatusBar: Made background transparent")
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
/// Restores the status bar background view to its original color
|
|
@@ -276,7 +276,7 @@ import Capacitor
|
|
|
276
276
|
self.updateStatusBarBackgroundView(in: window,
|
|
277
277
|
height: statusBarManager.statusBarFrame.height,
|
|
278
278
|
color: color)
|
|
279
|
-
print("
|
|
279
|
+
print("CapacitorStatusBar: Restored background color: \(color)")
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
|
|
@@ -5,10 +5,10 @@ import Capacitor
|
|
|
5
5
|
* Please read the Capacitor iOS Plugin Development Guide
|
|
6
6
|
* here: https://capacitorjs.com/docs/plugins/ios
|
|
7
7
|
*/
|
|
8
|
-
@objc(
|
|
9
|
-
public class
|
|
10
|
-
public let identifier = "
|
|
11
|
-
public let jsName = "
|
|
8
|
+
@objc(CapacitorStatusBarPlugin)
|
|
9
|
+
public class CapacitorStatusBarPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
10
|
+
public let identifier = "CapacitorStatusBarPlugin"
|
|
11
|
+
public let jsName = "CapacitorStatusBar"
|
|
12
12
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
13
13
|
CAPPluginMethod(name: "setStyle", returnType: CAPPluginReturnPromise),
|
|
14
14
|
CAPPluginMethod(name: "show", returnType: CAPPluginReturnPromise),
|
|
@@ -17,7 +17,7 @@ public class StatusBarPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
17
17
|
CAPPluginMethod(name: "setBackground", returnType: CAPPluginReturnPromise),
|
|
18
18
|
CAPPluginMethod(name: "getSafeAreaInsets", returnType: CAPPluginReturnPromise)
|
|
19
19
|
]
|
|
20
|
-
private let implementation =
|
|
20
|
+
private let implementation = CapacitorStatusBar()
|
|
21
21
|
|
|
22
22
|
override public func load() {
|
|
23
23
|
super.load()
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import XCTest
|
|
2
|
-
@testable import
|
|
2
|
+
@testable import CapacitorStatusBarPlugin
|
|
3
3
|
|
|
4
|
-
class
|
|
4
|
+
class CapacitorStatusBarTests: XCTestCase {
|
|
5
5
|
func testEcho() {
|
|
6
6
|
// This is an example of a functional test case for a plugin.
|
|
7
7
|
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
|
8
8
|
|
|
9
|
-
let implementation =
|
|
9
|
+
let implementation = CapacitorStatusBar()
|
|
10
10
|
let value = "Hello, World!"
|
|
11
11
|
let result = implementation.echo(value)
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-plugin-status-bar",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Capacitor plugin for managing the status bar style, visibility, and color on iOS and Android. Control overlay modes, background colors, and appearance for native mobile applications.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"eslint": "eslint . --ext ts",
|
|
58
58
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
59
59
|
"swiftlint": "node-swiftlint",
|
|
60
|
-
"docgen": "docgen --api
|
|
60
|
+
"docgen": "docgen --api CapacitorStatusBarPlugin --output-readme README.md --output-json dist/docs.json",
|
|
61
61
|
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
62
62
|
"clean": "rimraf ./dist",
|
|
63
63
|
"watch": "tsc --watch",
|