capacitor-plugin-status-bar 2.0.0 → 2.0.1

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.
@@ -400,25 +400,17 @@ public class StatusBar extends Plugin {
400
400
 
401
401
  private void applyStatusBarBackground(Activity activity, @ColorInt int color) {
402
402
  Log.d(TAG, "applyStatusBarBackground: color=#" + Integer.toHexString(color) + ", API=" + Build.VERSION.SDK_INT);
403
- Window window = activity.getWindow();
404
- if (Build.VERSION.SDK_INT >= 35) {
405
- ensureStatusBarOverlay(activity, color);
406
- } else {
407
- removeStatusBarOverlayIfPresent(activity);
408
- window.setStatusBarColor(color);
409
- }
403
+ // Use overlay approach for all API levels since edge-to-edge mode
404
+ // (setDecorFitsSystemWindows=false) makes window.setStatusBarColor() ineffective
405
+ ensureStatusBarOverlay(activity, color);
410
406
  }
411
407
 
412
408
  private void applyNavigationBarBackground(Activity activity, @ColorInt int color) {
413
409
  Log.d(TAG, "applyNavigationBarBackground: color=#" + Integer.toHexString(color) + ", API="
414
410
  + Build.VERSION.SDK_INT);
415
- Window window = activity.getWindow();
416
- if (Build.VERSION.SDK_INT >= 35) {
417
- ensureNavBarOverlay(activity, color);
418
- } else {
419
- removeNavBarOverlayIfPresent(activity);
420
- window.setNavigationBarColor(color);
421
- }
411
+ // Use overlay approach for all API levels since edge-to-edge mode
412
+ // (setDecorFitsSystemWindows=false) makes window.setNavigationBarColor() ineffective
413
+ ensureNavBarOverlay(activity, color);
422
414
  }
423
415
 
424
416
  private void ensureStatusBarOverlay(Activity activity, @ColorInt int color) {
@@ -537,26 +529,19 @@ public class StatusBar extends Plugin {
537
529
  Log.d(TAG, "makeStatusBarBackgroundTransparent: API=" + Build.VERSION.SDK_INT);
538
530
  Window window = activity.getWindow();
539
531
 
540
- if (Build.VERSION.SDK_INT >= 35) {
541
- // API 35+ (Android 15+) - Make overlay views transparent
542
- ViewGroup decorView = (ViewGroup) window.getDecorView();
543
- View statusBarOverlay = decorView.findViewWithTag(STATUS_BAR_OVERLAY_TAG);
544
- View navBarOverlay = decorView.findViewWithTag(NAV_BAR_OVERLAY_TAG);
532
+ // Make overlay views transparent (used for all API levels)
533
+ ViewGroup decorView = (ViewGroup) window.getDecorView();
534
+ View statusBarOverlay = decorView.findViewWithTag(STATUS_BAR_OVERLAY_TAG);
535
+ View navBarOverlay = decorView.findViewWithTag(NAV_BAR_OVERLAY_TAG);
545
536
 
546
- if (statusBarOverlay != null) {
547
- statusBarOverlay.setBackgroundColor(Color.TRANSPARENT);
548
- Log.d(TAG, "makeStatusBarBackgroundTransparent: status bar overlay made transparent");
549
- }
537
+ if (statusBarOverlay != null) {
538
+ statusBarOverlay.setBackgroundColor(Color.TRANSPARENT);
539
+ Log.d(TAG, "makeStatusBarBackgroundTransparent: status bar overlay made transparent");
540
+ }
550
541
 
551
- if (navBarOverlay != null) {
552
- navBarOverlay.setBackgroundColor(Color.TRANSPARENT);
553
- Log.d(TAG, "makeStatusBarBackgroundTransparent: navigation bar overlay made transparent");
554
- }
555
- } else {
556
- // API 29-34 - Make window bars transparent
557
- window.setStatusBarColor(Color.TRANSPARENT);
558
- window.setNavigationBarColor(Color.TRANSPARENT);
559
- Log.d(TAG, "makeStatusBarBackgroundTransparent: window bars made transparent");
542
+ if (navBarOverlay != null) {
543
+ navBarOverlay.setBackgroundColor(Color.TRANSPARENT);
544
+ Log.d(TAG, "makeStatusBarBackgroundTransparent: navigation bar overlay made transparent");
560
545
  }
561
546
  }
562
547
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-plugin-status-bar",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
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",