forgot to push

This commit is contained in:
olcxja 2026-05-08 18:07:14 +02:00
commit 4942043ae3
28 changed files with 2458 additions and 0 deletions

View file

@ -0,0 +1,17 @@
require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = 'CapacitorStatusBar'
s.version = package['version']
s.summary = package['description']
s.license = package['license']
s.homepage = 'https://capacitorjs.com'
s.author = package['author']
s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] }
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'status-bar/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '15.0'
s.dependency 'Capacitor'
s.swift_version = '5.1'
end

23
node_modules/@capacitor/status-bar/LICENSE generated vendored Normal file
View file

@ -0,0 +1,23 @@
Copyright 2020-present Ionic
https://ionic.io
MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

29
node_modules/@capacitor/status-bar/Package.swift generated vendored Normal file
View file

@ -0,0 +1,29 @@
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "CapacitorStatusBar",
platforms: [.iOS(.v15)],
products: [
.library(
name: "CapacitorStatusBar",
targets: ["StatusBarPlugin"])
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
],
targets: [
.target(
name: "StatusBarPlugin",
dependencies: [
.product(name: "Capacitor", package: "capacitor-swift-pm"),
.product(name: "Cordova", package: "capacitor-swift-pm")],
path: "ios/Sources/StatusBarPlugin"
),
.testTarget(
name: "StatusBarPluginTests",
dependencies: ["StatusBarPlugin"],
path: "ios/Tests/StatusBarPluginTests")
]
)

373
node_modules/@capacitor/status-bar/README.md generated vendored Normal file
View file

@ -0,0 +1,373 @@
# @capacitor/status-bar
The StatusBar API Provides methods for configuring the style of the Status Bar, along with showing or hiding it.
## Install
```bash
npm install @capacitor/status-bar
npx cap sync
```
## Android 16+ behavior change
For apps targeting **Android 16 (API level 36)** and higher using **Capacitor 8**, the following Status Bar configuration options **no longer work**:
- `overlaysWebView`
- `backgroundColor`
These options relied on the ability to opt out of Androids **edge-to-edge** system UI behavior, which allowed apps to control how the status bar overlays and its background color.
In **Android 15 (API level 35)**, it was still possible to opt out of this enforced behavior by setting the `windowOptOutEdgeToEdgeEnforcement` property in the application layout file.
Without that property, the application assumed `overlaysWebView` as always `true`.
See more details in the Android documentation: [https://developer.android.com/reference/android/R.attr#windowOptOutEdgeToEdgeEnforcement](https://developer.android.com.reference/android/R.attr#windowOptOutEdgeToEdgeEnforcement)
Starting with **Android 16**, this opt-out is **no longer available**, and the behavior is enforced by the system.
As a result, the `overlaysWebView` and `backgroundColor` configuration options no longer have any effect.
## iOS Note
This plugin requires "View controller-based status bar appearance"
(`UIViewControllerBasedStatusBarAppearance`) set to `YES` in `Info.plist`. Read
about [Configuring iOS](https://capacitorjs.com/docs/ios/configuration) for
help.
The status bar visibility defaults to visible and the style defaults to
`Style.Default`. You can change these defaults by adding
`UIStatusBarHidden` and/or `UIStatusBarStyle` in `Info.plist`.
## Example
```typescript
import { StatusBar, Style } from '@capacitor/status-bar';
// iOS only
window.addEventListener('statusTap', function () {
console.log('statusbar tapped');
});
// Display content under transparent status bar
StatusBar.setOverlaysWebView({ overlay: true });
const setStatusBarStyleDark = async () => {
await StatusBar.setStyle({ style: Style.Dark });
};
const setStatusBarStyleLight = async () => {
await StatusBar.setStyle({ style: Style.Light });
};
const hideStatusBar = async () => {
await StatusBar.hide();
};
const showStatusBar = async () => {
await StatusBar.show();
};
```
## Configuration
<docgen-config>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
These config values are available:
| Prop | Type | Description | Default | Since |
| --------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----- |
| **`overlaysWebView`** | <code>boolean</code> | Whether the statusbar is overlaid or not. Not available on Android 15+. | <code>true</code> | 1.0.0 |
| **`style`** | <code>string</code> | <a href="#style">Style</a> of the text of the status bar. | <code>default</code> | 1.0.0 |
| **`backgroundColor`** | <code>string</code> | Color of the background of the statusbar in hex format, #RRGGBB. Doesn't work if `overlaysWebView` is true. Not available on Android 15+. | <code>#000000</code> | 1.0.0 |
### Examples
In `capacitor.config.json`:
```json
{
"plugins": {
"StatusBar": {
"overlaysWebView": false,
"style": "DARK",
"backgroundColor": "#ffffffff"
}
}
}
```
In `capacitor.config.ts`:
```ts
/// <reference types="@capacitor/status-bar" />
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
plugins: {
StatusBar: {
overlaysWebView: false,
style: "DARK",
backgroundColor: "#ffffffff",
},
},
};
export default config;
```
</docgen-config>
## API
<docgen-index>
* [`setStyle(...)`](#setstyle)
* [`setBackgroundColor(...)`](#setbackgroundcolor)
* [`show(...)`](#show)
* [`hide(...)`](#hide)
* [`getInfo()`](#getinfo)
* [`setOverlaysWebView(...)`](#setoverlayswebview)
* [`addListener('statusBarVisibilityChanged', ...)`](#addlistenerstatusbarvisibilitychanged-)
* [`addListener('statusBarOverlayChanged', ...)`](#addlistenerstatusbaroverlaychanged-)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)
* [Enums](#enums)
</docgen-index>
<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
### setStyle(...)
```typescript
setStyle(options: StyleOptions) => Promise<void>
```
Set the current style of the status bar.
| Param | Type |
| ------------- | ----------------------------------------------------- |
| **`options`** | <code><a href="#styleoptions">StyleOptions</a></code> |
**Since:** 1.0.0
--------------------
### setBackgroundColor(...)
```typescript
setBackgroundColor(options: BackgroundColorOptions) => Promise<void>
```
Set the background color of the status bar.
Calling this function updates the foreground color of the status bar if the style is set to default, except on iOS versions lower than 17.
Not available on Android 15+.
| Param | Type |
| ------------- | ------------------------------------------------------------------------- |
| **`options`** | <code><a href="#backgroundcoloroptions">BackgroundColorOptions</a></code> |
**Since:** 1.0.0
--------------------
### show(...)
```typescript
show(options?: AnimationOptions | undefined) => Promise<void>
```
Show the status bar.
On iOS, if the status bar is initially hidden and the initial style is set to
`UIStatusBarStyleLightContent`, first show call might present a glitch on the
animation showing the text as dark and then transition to light. It's recommended
to use <a href="#animation">`Animation.None`</a> as the animation on the first call.
| Param | Type |
| ------------- | ------------------------------------------------------------- |
| **`options`** | <code><a href="#animationoptions">AnimationOptions</a></code> |
**Since:** 1.0.0
--------------------
### hide(...)
```typescript
hide(options?: AnimationOptions | undefined) => Promise<void>
```
Hide the status bar.
| Param | Type |
| ------------- | ------------------------------------------------------------- |
| **`options`** | <code><a href="#animationoptions">AnimationOptions</a></code> |
**Since:** 1.0.0
--------------------
### getInfo()
```typescript
getInfo() => Promise<StatusBarInfo>
```
Get info about the current state of the status bar.
**Returns:** <code>Promise&lt;<a href="#statusbarinfo">StatusBarInfo</a>&gt;</code>
**Since:** 1.0.0
--------------------
### setOverlaysWebView(...)
```typescript
setOverlaysWebView(options: SetOverlaysWebViewOptions) => Promise<void>
```
Set whether or not the status bar should overlay the webview to allow usage
of the space underneath it.
Not available on Android 15+.
| Param | Type |
| ------------- | ------------------------------------------------------------------------------- |
| **`options`** | <code><a href="#setoverlayswebviewoptions">SetOverlaysWebViewOptions</a></code> |
**Since:** 1.0.0
--------------------
### addListener('statusBarVisibilityChanged', ...)
```typescript
addListener(eventName: 'statusBarVisibilityChanged', listenerFunc: VisibilityChangeListener) => Promise<PluginListenerHandle>
```
Listen for status bar visibility changes.
Fired when hide or show methods get called.
| Param | Type |
| ------------------ | ----------------------------------------------------------------------------- |
| **`eventName`** | <code>'statusBarVisibilityChanged'</code> |
| **`listenerFunc`** | <code><a href="#visibilitychangelistener">VisibilityChangeListener</a></code> |
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
**Since:** 7.0.0
--------------------
### addListener('statusBarOverlayChanged', ...)
```typescript
addListener(eventName: 'statusBarOverlayChanged', listenerFunc: OverlayChangeListener) => Promise<PluginListenerHandle>
```
Listen for status bar overlay changes.
Fired when setOverlaysWebView gets called.
| Param | Type |
| ------------------ | ----------------------------------------------------------------------- |
| **`eventName`** | <code>'statusBarOverlayChanged'</code> |
| **`listenerFunc`** | <code><a href="#overlaychangelistener">OverlayChangeListener</a></code> |
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
**Since:** 7.0.0
--------------------
### Interfaces
#### StyleOptions
| Prop | Type | Description | Since |
| ----------- | --------------------------------------- | --------------------------------------------------------- | ----- |
| **`style`** | <code><a href="#style">Style</a></code> | <a href="#style">Style</a> of the text of the status bar. | 1.0.0 |
#### BackgroundColorOptions
| Prop | Type | Description | Since |
| ----------- | ------------------- | ------------------------------------------------- | ----- |
| **`color`** | <code>string</code> | A hex color to which the status bar color is set. | 1.0.0 |
#### AnimationOptions
| Prop | Type | Description | Default | Since |
| --------------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------- | ----- |
| **`animation`** | <code><a href="#animation">Animation</a></code> | The type of status bar animation used when showing or hiding. This option is only supported on iOS. | <code>Animation.Fade</code> | 1.0.0 |
#### StatusBarInfo
| Prop | Type | Description | Since |
| -------------- | --------------------------------------- | ------------------------------------------ | ----- |
| **`visible`** | <code>boolean</code> | Whether the status bar is visible or not. | 1.0.0 |
| **`style`** | <code><a href="#style">Style</a></code> | The current status bar style. | 1.0.0 |
| **`color`** | <code>string</code> | The current status bar color. | 1.0.0 |
| **`overlays`** | <code>boolean</code> | Whether the status bar is overlaid or not. | 1.0.0 |
| **`height`** | <code>number</code> | The height of the status bar. | 7.0.0 |
#### SetOverlaysWebViewOptions
| Prop | Type | Description | Since |
| ------------- | -------------------- | ----------------------------------------- | ----- |
| **`overlay`** | <code>boolean</code> | Whether to overlay the status bar or not. | 1.0.0 |
#### PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |
### Type Aliases
#### VisibilityChangeListener
<code>(info: <a href="#statusbarinfo">StatusBarInfo</a>): void</code>
#### OverlayChangeListener
<code>(info: <a href="#statusbarinfo">StatusBarInfo</a>): void</code>
### Enums
#### Style
| Members | Value | Description | Since |
| ------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
| **`Dark`** | <code>'DARK'</code> | Light text for dark backgrounds. | 1.0.0 |
| **`Light`** | <code>'LIGHT'</code> | Dark text for light backgrounds. | 1.0.0 |
| **`Default`** | <code>'DEFAULT'</code> | The style is based on the device appearance. If the device is using Dark mode, the statusbar text will be light. If the device is using Light mode, the statusbar text will be dark. | 1.0.0 |
#### Animation
| Members | Value | Description | Since |
| ----------- | -------------------- | ------------------------------------------------------------- | ----- |
| **`None`** | <code>'NONE'</code> | No animation during show/hide. | 1.0.0 |
| **`Slide`** | <code>'SLIDE'</code> | Slide animation during show/hide. It doesn't work on iOS 15+. | 1.0.0 |
| **`Fade`** | <code>'FADE'</code> | Fade animation during show/hide. | 1.0.0 |
</docgen-api>

View file

@ -0,0 +1,81 @@
ext {
capacitorVersion = System.getenv('CAPACITOR_VERSION')
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.17.0'
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
}
buildscript {
repositories {
google()
mavenCentral()
maven {
url = "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:8.13.0'
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
}
}
}
apply plugin: 'com.android.library'
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply from: file('../../scripts/android/publish-root.gradle')
apply from: file('../../scripts/android/publish-module.gradle')
}
android {
namespace = "com.capacitorjs.plugins.statusbar"
compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
defaultConfig {
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
publishing {
singleVariant("release")
}
}
repositories {
google()
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
implementation "com.capacitorjs:core:$capacitorVersion"
} else {
implementation project(':capacitor-android')
}
implementation "androidx.core:core:$androidxCoreVersion"
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
}

View file

@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

View file

@ -0,0 +1,234 @@
package com.capacitorjs.plugins.statusbar;
import android.content.res.Configuration;
import android.graphics.Color;
import android.os.Build;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.View;
import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowManager;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.ColorUtils;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.core.view.WindowInsetsControllerCompat;
public class StatusBar {
public static final String statusBarVisibilityChanged = "statusBarVisibilityChanged";
public static final String statusBarOverlayChanged = "statusBarOverlayChanged";
private int currentStatusBarColor;
private final ChangeListener listener;
private final AppCompatActivity activity;
private String currentStyle = "DEFAULT";
public StatusBar(AppCompatActivity activity, StatusBarConfig config, ChangeListener listener) {
// save initial color of the status bar
this.activity = activity;
this.currentStatusBarColor = getStatusBarColorDeprecated();
this.listener = listener;
setBackgroundColor(config.getBackgroundColor());
setStyle(config.getStyle());
setOverlaysWebView(config.isOverlaysWebView());
StatusBarInfo info = getInfo();
info.setVisible(true);
listener.onChange(statusBarOverlayChanged, info);
}
public void setStyle(String style) {
Window window = activity.getWindow();
View decorView = window.getDecorView();
this.currentStyle = style;
if (style.equals("DEFAULT")) {
style = getStyleForTheme();
}
WindowInsetsControllerCompat windowInsetsControllerCompat = WindowCompat.getInsetsController(window, decorView);
windowInsetsControllerCompat.setAppearanceLightStatusBars(!style.equals("DARK"));
}
private String getStyleForTheme() {
int currentNightMode = activity.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
if (currentNightMode != Configuration.UI_MODE_NIGHT_YES) {
return "LIGHT";
}
return "DARK";
}
public void updateStyle() {
setStyle(this.currentStyle);
}
public void setBackgroundColor(int color) {
Window window = activity.getWindow();
if (shouldSetStatusBarColor(isEdgeToEdgeOptOutEnabled(window))) {
clearTranslucentStatusFlagDeprecated();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
setStatusBarColorDeprecated(color);
currentStatusBarColor = color;
// only set foreground color if style is default
if (currentStyle.equals("DEFAULT")) {
// determine if the color is light or dark using luminance and set icon color
boolean isLightColor = ColorUtils.calculateLuminance(color) > 0.5;
WindowInsetsControllerCompat insetsController = WindowCompat.getInsetsController(window, window.getDecorView());
insetsController.setAppearanceLightStatusBars(isLightColor);
}
}
}
public void hide() {
View decorView = activity.getWindow().getDecorView();
WindowInsetsControllerCompat windowInsetsControllerCompat = WindowCompat.getInsetsController(activity.getWindow(), decorView);
windowInsetsControllerCompat.hide(WindowInsetsCompat.Type.statusBars());
StatusBarInfo info = getInfo();
info.setVisible(false);
listener.onChange(statusBarVisibilityChanged, info);
}
public void show() {
View decorView = activity.getWindow().getDecorView();
WindowInsetsControllerCompat windowInsetsControllerCompat = WindowCompat.getInsetsController(activity.getWindow(), decorView);
windowInsetsControllerCompat.show(WindowInsetsCompat.Type.statusBars());
StatusBarInfo info = getInfo();
info.setVisible(true);
listener.onChange(statusBarVisibilityChanged, info);
}
public void setOverlaysWebView(Boolean overlays) {
View decorView = activity.getWindow().getDecorView();
int uiOptions = getSystemUiVisibilityDeprecated(decorView);
if (overlays) {
// Sets the layout to a fullscreen one that does not hide the actual status bar, so the WebView is displayed behind it.
uiOptions = uiOptions | getSystemUiFlagLayoutStableDeprecated() | getSystemUiFlagLayoutFullscreenDeprecated();
setSystemUiVisibilityDeprecated(decorView, uiOptions);
currentStatusBarColor = getStatusBarColorDeprecated();
setStatusBarColorDeprecated(Color.TRANSPARENT);
} else {
// Sets the layout to a normal one that displays the WebView below the status bar.
uiOptions = uiOptions & ~getSystemUiFlagLayoutStableDeprecated() & ~getSystemUiFlagLayoutFullscreenDeprecated();
setSystemUiVisibilityDeprecated(decorView, uiOptions);
// recover the previous color of the status bar
setStatusBarColorDeprecated(currentStatusBarColor);
}
listener.onChange(statusBarOverlayChanged, getInfo());
}
private boolean shouldSetStatusBarColor(boolean hasOptOut) {
boolean canSetStatusBar;
int deviceApi = Build.VERSION.SDK_INT;
if (deviceApi < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
// device below Android 15 - can always set status bar
canSetStatusBar = true;
} else if (deviceApi == Build.VERSION_CODES.VANILLA_ICE_CREAM) {
canSetStatusBar = hasOptOut; // app targets 15 - can set status bar if opted out
} else {
canSetStatusBar = false; // app targets 16 - opt-out ignored or app targets 15 but there is not opt out
}
return canSetStatusBar;
}
private boolean isEdgeToEdgeOptOutEnabled(Window window) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
TypedValue value = new TypedValue();
window.getContext().getTheme().resolveAttribute(android.R.attr.windowOptOutEdgeToEdgeEnforcement, value, true);
return value.data != 0; // value is set to -1 on true as of Android 15, so we have to do this.
}
return false;
}
private boolean getIsOverlaid() {
return (
(getSystemUiVisibilityDeprecated(activity.getWindow().getDecorView()) & getSystemUiFlagLayoutFullscreenDeprecated()) ==
getSystemUiFlagLayoutFullscreenDeprecated()
);
}
public StatusBarInfo getInfo() {
Window window = activity.getWindow();
WindowInsetsCompat windowInsetsCompat = ViewCompat.getRootWindowInsets(window.getDecorView());
boolean isVisible = windowInsetsCompat != null && windowInsetsCompat.isVisible(WindowInsetsCompat.Type.statusBars());
StatusBarInfo info = new StatusBarInfo();
info.setStyle(getStyle());
info.setOverlays(getIsOverlaid());
info.setVisible(isVisible);
info.setColor(String.format("#%06X", (0xFFFFFF & getStatusBarColorDeprecated())));
info.setHeight(getStatusBarHeight());
return info;
}
private String getStyle() {
View decorView = activity.getWindow().getDecorView();
String style = "DARK";
WindowInsetsControllerCompat windowInsetsControllerCompat = WindowCompat.getInsetsController(activity.getWindow(), decorView);
if (windowInsetsControllerCompat.isAppearanceLightStatusBars()) {
style = "LIGHT";
}
return style;
}
private int getStatusBarHeight() {
DisplayMetrics metrics = activity.getResources().getDisplayMetrics();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
WindowInsets insets = activity.getWindowManager().getCurrentWindowMetrics().getWindowInsets();
return (int) (insets.getInsets(WindowInsets.Type.statusBars()).top / metrics.density);
}
WindowInsets insets = activity.getWindow().getDecorView().getRootWindowInsets();
if (insets != null) {
return getSystemWindowInsetTopDeprecated(insets, metrics);
}
// Fallback if the insets are not available
return 0;
}
public interface ChangeListener {
void onChange(String eventName, StatusBarInfo info);
}
@SuppressWarnings("deprecation")
private int getStatusBarColorDeprecated() {
return activity.getWindow().getStatusBarColor();
}
@SuppressWarnings("deprecation")
private void setStatusBarColorDeprecated(int color) {
activity.getWindow().setStatusBarColor(color);
}
@SuppressWarnings("deprecation")
private void clearTranslucentStatusFlagDeprecated() {
activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
@SuppressWarnings("deprecation")
private int getSystemUiVisibilityDeprecated(View decorView) {
return decorView.getSystemUiVisibility();
}
@SuppressWarnings("deprecation")
private void setSystemUiVisibilityDeprecated(View decorView, int uiOptions) {
decorView.setSystemUiVisibility(uiOptions);
}
@SuppressWarnings("deprecation")
private int getSystemUiFlagLayoutStableDeprecated() {
return View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
}
@SuppressWarnings("deprecation")
private int getSystemUiFlagLayoutFullscreenDeprecated() {
return View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
}
@SuppressWarnings("deprecation")
private int getSystemWindowInsetTopDeprecated(WindowInsets insets, DisplayMetrics metrics) {
return (int) (insets.getSystemWindowInsetTop() / metrics.density);
}
}

View file

@ -0,0 +1,34 @@
package com.capacitorjs.plugins.statusbar;
import com.getcapacitor.util.WebColor;
public class StatusBarConfig {
private boolean overlaysWebView = true;
private Integer backgroundColor = WebColor.parseColor("#000000");
private String style = "DEFAULT";
public boolean isOverlaysWebView() {
return overlaysWebView;
}
public void setOverlaysWebView(boolean overlaysWebView) {
this.overlaysWebView = overlaysWebView;
}
public Integer getBackgroundColor() {
return backgroundColor;
}
public void setBackgroundColor(Integer backgroundColor) {
this.backgroundColor = backgroundColor;
}
public String getStyle() {
return style;
}
public void setStyle(String style) {
this.style = style;
}
}

View file

@ -0,0 +1,52 @@
package com.capacitorjs.plugins.statusbar;
import java.io.Serializable;
public class StatusBarInfo implements Serializable {
private boolean overlays;
private boolean visible;
private String style;
private String color;
private int height;
public boolean isOverlays() {
return overlays;
}
public void setOverlays(boolean overlays) {
this.overlays = overlays;
}
public boolean isVisible() {
return visible;
}
public void setVisible(boolean visible) {
this.visible = visible;
}
public String getStyle() {
return style;
}
public void setStyle(String style) {
this.style = style;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
}

View file

@ -0,0 +1,134 @@
package com.capacitorjs.plugins.statusbar;
import android.content.res.Configuration;
import com.getcapacitor.JSObject;
import com.getcapacitor.Logger;
import com.getcapacitor.Plugin;
import com.getcapacitor.PluginCall;
import com.getcapacitor.PluginMethod;
import com.getcapacitor.annotation.CapacitorPlugin;
import com.getcapacitor.util.WebColor;
import java.util.Locale;
@CapacitorPlugin(name = "StatusBar")
public class StatusBarPlugin extends Plugin {
private StatusBar implementation;
@Override
public void load() {
StatusBarConfig config = getStatusBarConfig();
implementation = new StatusBar(getActivity(), config, (eventName, info) -> notifyListeners(eventName, toJSObject(info), true));
}
private StatusBarConfig getStatusBarConfig() {
StatusBarConfig config = new StatusBarConfig();
String backgroundColor = getConfig().getString("backgroundColor");
if (backgroundColor != null) {
try {
config.setBackgroundColor(WebColor.parseColor(backgroundColor));
} catch (IllegalArgumentException ex) {
Logger.debug("Background color not applied");
}
}
config.setStyle(styleFromConfig(getConfig().getString("style", config.getStyle())));
config.setOverlaysWebView(getConfig().getBoolean("overlaysWebView", config.isOverlaysWebView()));
return config;
}
private String styleFromConfig(String style) {
switch (style.toLowerCase()) {
case "lightcontent":
case "dark":
return "DARK";
case "darkcontent":
case "light":
return "LIGHT";
case "default":
default:
return "DEFAULT";
}
}
@Override
protected void handleOnConfigurationChanged(Configuration newConfig) {
super.handleOnConfigurationChanged(newConfig);
implementation.updateStyle();
}
@PluginMethod
public void setStyle(final PluginCall call) {
final String style = call.getString("style");
if (style == null) {
call.reject("Style must be provided");
return;
}
getBridge().executeOnMainThread(() -> {
implementation.setStyle(style);
call.resolve();
});
}
@PluginMethod
public void setBackgroundColor(final PluginCall call) {
final String color = call.getString("color");
if (color == null) {
call.reject("Color must be provided");
return;
}
getBridge().executeOnMainThread(() -> {
try {
final int parsedColor = WebColor.parseColor(color.toUpperCase(Locale.ROOT));
implementation.setBackgroundColor(parsedColor);
call.resolve();
} catch (IllegalArgumentException ex) {
call.reject("Invalid color provided. Must be a hex string (ex: #ff0000");
}
});
}
@PluginMethod
public void hide(final PluginCall call) {
// Hide the status bar.
getBridge().executeOnMainThread(() -> {
implementation.hide();
call.resolve();
});
}
@PluginMethod
public void show(final PluginCall call) {
// Show the status bar.
getBridge().executeOnMainThread(() -> {
implementation.show();
call.resolve();
});
}
@PluginMethod
public void getInfo(final PluginCall call) {
StatusBarInfo info = implementation.getInfo();
call.resolve(toJSObject(info));
}
@PluginMethod
public void setOverlaysWebView(final PluginCall call) {
final Boolean overlay = call.getBoolean("overlay", true);
getBridge().executeOnMainThread(() -> {
implementation.setOverlaysWebView(overlay);
call.resolve();
});
}
private JSObject toJSObject(StatusBarInfo info) {
JSObject data = new JSObject();
data.put("visible", info.isVisible());
data.put("style", info.getStyle());
data.put("color", info.getColor());
data.put("overlays", info.isOverlays());
data.put("height", info.getHeight());
return data;
}
}

563
node_modules/@capacitor/status-bar/dist/docs.json generated vendored Normal file
View file

@ -0,0 +1,563 @@
{
"api": {
"name": "StatusBarPlugin",
"slug": "statusbarplugin",
"docs": "",
"tags": [],
"methods": [
{
"name": "setStyle",
"signature": "(options: StyleOptions) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "",
"type": "StyleOptions"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "since",
"text": "1.0.0"
}
],
"docs": "Set the current style of the status bar.",
"complexTypes": [
"StyleOptions"
],
"slug": "setstyle"
},
{
"name": "setBackgroundColor",
"signature": "(options: BackgroundColorOptions) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "",
"type": "BackgroundColorOptions"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "since",
"text": "1.0.0"
}
],
"docs": "Set the background color of the status bar.\nCalling this function updates the foreground color of the status bar if the style is set to default, except on iOS versions lower than 17.\nNot available on Android 15+.",
"complexTypes": [
"BackgroundColorOptions"
],
"slug": "setbackgroundcolor"
},
{
"name": "show",
"signature": "(options?: AnimationOptions | undefined) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "",
"type": "AnimationOptions | undefined"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "since",
"text": "1.0.0"
}
],
"docs": "Show the status bar.\nOn iOS, if the status bar is initially hidden and the initial style is set to\n`UIStatusBarStyleLightContent`, first show call might present a glitch on the\nanimation showing the text as dark and then transition to light. It's recommended\nto use `Animation.None` as the animation on the first call.",
"complexTypes": [
"AnimationOptions"
],
"slug": "show"
},
{
"name": "hide",
"signature": "(options?: AnimationOptions | undefined) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "",
"type": "AnimationOptions | undefined"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "since",
"text": "1.0.0"
}
],
"docs": "Hide the status bar.",
"complexTypes": [
"AnimationOptions"
],
"slug": "hide"
},
{
"name": "getInfo",
"signature": "() => Promise<StatusBarInfo>",
"parameters": [],
"returns": "Promise<StatusBarInfo>",
"tags": [
{
"name": "since",
"text": "1.0.0"
}
],
"docs": "Get info about the current state of the status bar.",
"complexTypes": [
"StatusBarInfo"
],
"slug": "getinfo"
},
{
"name": "setOverlaysWebView",
"signature": "(options: SetOverlaysWebViewOptions) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "",
"type": "SetOverlaysWebViewOptions"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "since",
"text": "1.0.0"
}
],
"docs": "Set whether or not the status bar should overlay the webview to allow usage\nof the space underneath it.\nNot available on Android 15+.",
"complexTypes": [
"SetOverlaysWebViewOptions"
],
"slug": "setoverlayswebview"
},
{
"name": "addListener",
"signature": "(eventName: 'statusBarVisibilityChanged', listenerFunc: VisibilityChangeListener) => Promise<PluginListenerHandle>",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "'statusBarVisibilityChanged'"
},
{
"name": "listenerFunc",
"docs": "",
"type": "VisibilityChangeListener"
}
],
"returns": "Promise<PluginListenerHandle>",
"tags": [
{
"name": "since",
"text": "7.0.0"
}
],
"docs": "Listen for status bar visibility changes.\nFired when hide or show methods get called.",
"complexTypes": [
"PluginListenerHandle",
"VisibilityChangeListener"
],
"slug": "addlistenerstatusbarvisibilitychanged-"
},
{
"name": "addListener",
"signature": "(eventName: 'statusBarOverlayChanged', listenerFunc: OverlayChangeListener) => Promise<PluginListenerHandle>",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "'statusBarOverlayChanged'"
},
{
"name": "listenerFunc",
"docs": "",
"type": "OverlayChangeListener"
}
],
"returns": "Promise<PluginListenerHandle>",
"tags": [
{
"name": "since",
"text": "7.0.0"
}
],
"docs": "Listen for status bar overlay changes.\nFired when setOverlaysWebView gets called.",
"complexTypes": [
"PluginListenerHandle",
"OverlayChangeListener"
],
"slug": "addlistenerstatusbaroverlaychanged-"
}
],
"properties": []
},
"interfaces": [
{
"name": "StyleOptions",
"slug": "styleoptions",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "style",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "Style of the text of the status bar.",
"complexTypes": [
"Style"
],
"type": "Style"
}
]
},
{
"name": "BackgroundColorOptions",
"slug": "backgroundcoloroptions",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "color",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "A hex color to which the status bar color is set.",
"complexTypes": [],
"type": "string"
}
]
},
{
"name": "AnimationOptions",
"slug": "animationoptions",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "animation",
"tags": [
{
"text": "Animation.Fade",
"name": "default"
},
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "The type of status bar animation used when showing or hiding.\n\nThis option is only supported on iOS.",
"complexTypes": [
"Animation"
],
"type": "Animation"
}
]
},
{
"name": "StatusBarInfo",
"slug": "statusbarinfo",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "visible",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "Whether the status bar is visible or not.",
"complexTypes": [],
"type": "boolean"
},
{
"name": "style",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "The current status bar style.",
"complexTypes": [
"Style"
],
"type": "Style"
},
{
"name": "color",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "The current status bar color.",
"complexTypes": [],
"type": "string"
},
{
"name": "overlays",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "Whether the status bar is overlaid or not.",
"complexTypes": [],
"type": "boolean"
},
{
"name": "height",
"tags": [
{
"text": "7.0.0",
"name": "since"
}
],
"docs": "The height of the status bar.",
"complexTypes": [],
"type": "number"
}
]
},
{
"name": "SetOverlaysWebViewOptions",
"slug": "setoverlayswebviewoptions",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "overlay",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "Whether to overlay the status bar or not.",
"complexTypes": [],
"type": "boolean"
}
]
},
{
"name": "PluginListenerHandle",
"slug": "pluginlistenerhandle",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "remove",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "() => Promise<void>"
}
]
}
],
"enums": [
{
"name": "Style",
"slug": "style",
"members": [
{
"name": "Dark",
"value": "'DARK'",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "Light text for dark backgrounds."
},
{
"name": "Light",
"value": "'LIGHT'",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "Dark text for light backgrounds."
},
{
"name": "Default",
"value": "'DEFAULT'",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "The style is based on the device appearance.\nIf the device is using Dark mode, the statusbar text will be light.\nIf the device is using Light mode, the statusbar text will be dark."
}
]
},
{
"name": "Animation",
"slug": "animation",
"members": [
{
"name": "None",
"value": "'NONE'",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "No animation during show/hide."
},
{
"name": "Slide",
"value": "'SLIDE'",
"tags": [
{
"text": "Use Animation.Fade or Animation.None instead.",
"name": "deprecated"
},
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "Slide animation during show/hide.\nIt doesn't work on iOS 15+."
},
{
"name": "Fade",
"value": "'FADE'",
"tags": [
{
"text": "1.0.0",
"name": "since"
}
],
"docs": "Fade animation during show/hide."
}
]
}
],
"typeAliases": [
{
"name": "VisibilityChangeListener",
"slug": "visibilitychangelistener",
"docs": "",
"types": [
{
"text": "(info: StatusBarInfo): void",
"complexTypes": [
"StatusBarInfo"
]
}
]
},
{
"name": "OverlayChangeListener",
"slug": "overlaychangelistener",
"docs": "",
"types": [
{
"text": "(info: StatusBarInfo): void",
"complexTypes": [
"StatusBarInfo"
]
}
]
}
],
"pluginConfigs": [
{
"name": "StatusBar",
"slug": "statusbar",
"properties": [
{
"name": "overlaysWebView",
"tags": [
{
"text": "1.0.0",
"name": "since"
},
{
"text": "true",
"name": "default"
},
{
"text": "false",
"name": "example"
}
],
"docs": "Whether the statusbar is overlaid or not.\nNot available on Android 15+.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "style",
"tags": [
{
"text": "1.0.0",
"name": "since"
},
{
"text": "default",
"name": "default"
},
{
"text": "\"DARK\"",
"name": "example"
}
],
"docs": "Style of the text of the status bar.",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "backgroundColor",
"tags": [
{
"text": "1.0.0",
"name": "since"
},
{
"text": "#000000",
"name": "default"
},
{
"text": "\"#ffffffff\"",
"name": "example"
}
],
"docs": "Color of the background of the statusbar in hex format, #RRGGBB.\nDoesn't work if `overlaysWebView` is true.\nNot available on Android 15+.",
"complexTypes": [],
"type": "string | undefined"
}
],
"docs": "These config values are available:"
}
]
}

View file

@ -0,0 +1,247 @@
import type { PluginListenerHandle } from '@capacitor/core';
declare module '@capacitor/cli' {
interface PluginsConfig {
/**
* These config values are available:
*/
StatusBar?: {
/**
* Whether the statusbar is overlaid or not.
* Not available on Android 15+.
*
* @since 1.0.0
* @default true
* @example false
*/
overlaysWebView?: boolean;
/**
* Style of the text of the status bar.
*
* @since 1.0.0
* @default default
* @example "DARK"
*/
style?: string;
/**
* Color of the background of the statusbar in hex format, #RRGGBB.
* Doesn't work if `overlaysWebView` is true.
* Not available on Android 15+.
*
* @since 1.0.0
* @default #000000
* @example "#ffffffff"
*/
backgroundColor?: string;
};
}
}
export interface StyleOptions {
/**
* Style of the text of the status bar.
*
* @since 1.0.0
*/
style: Style;
}
export declare enum Style {
/**
* Light text for dark backgrounds.
*
* @since 1.0.0
*/
Dark = "DARK",
/**
* Dark text for light backgrounds.
*
* @since 1.0.0
*/
Light = "LIGHT",
/**
* The style is based on the device appearance.
* If the device is using Dark mode, the statusbar text will be light.
* If the device is using Light mode, the statusbar text will be dark.
*
* @since 1.0.0
*/
Default = "DEFAULT"
}
export interface AnimationOptions {
/**
* The type of status bar animation used when showing or hiding.
*
* This option is only supported on iOS.
*
* @default Animation.Fade
*
* @since 1.0.0
*/
animation: Animation;
}
export declare enum Animation {
/**
* No animation during show/hide.
*
* @since 1.0.0
*/
None = "NONE",
/**
* Slide animation during show/hide.
* It doesn't work on iOS 15+.
*
* @deprecated Use Animation.Fade or Animation.None instead.
*
* @since 1.0.0
*/
Slide = "SLIDE",
/**
* Fade animation during show/hide.
*
* @since 1.0.0
*/
Fade = "FADE"
}
export interface BackgroundColorOptions {
/**
* A hex color to which the status bar color is set.
*
* @since 1.0.0
*/
color: string;
}
export interface StatusBarInfo {
/**
* Whether the status bar is visible or not.
*
* @since 1.0.0
*/
visible: boolean;
/**
* The current status bar style.
*
* @since 1.0.0
*/
style: Style;
/**
* The current status bar color.
*
* @since 1.0.0
*/
color: string;
/**
* Whether the status bar is overlaid or not.
*
* @since 1.0.0
*/
overlays: boolean;
/**
* The height of the status bar.
*
* @since 7.0.0
*/
height: number;
}
export interface SetOverlaysWebViewOptions {
/**
* Whether to overlay the status bar or not.
*
* @since 1.0.0
*/
overlay: boolean;
}
export type VisibilityChangeListener = (info: StatusBarInfo) => void;
export type OverlayChangeListener = (info: StatusBarInfo) => void;
export interface StatusBarPlugin {
/**
* Set the current style of the status bar.
*
* @since 1.0.0
*/
setStyle(options: StyleOptions): Promise<void>;
/**
* Set the background color of the status bar.
* Calling this function updates the foreground color of the status bar if the style is set to default, except on iOS versions lower than 17.
* Not available on Android 15+.
*
* @since 1.0.0
*/
setBackgroundColor(options: BackgroundColorOptions): Promise<void>;
/**
* Show the status bar.
* On iOS, if the status bar is initially hidden and the initial style is set to
* `UIStatusBarStyleLightContent`, first show call might present a glitch on the
* animation showing the text as dark and then transition to light. It's recommended
* to use `Animation.None` as the animation on the first call.
*
* @since 1.0.0
*/
show(options?: AnimationOptions): Promise<void>;
/**
* Hide the status bar.
*
* @since 1.0.0
*/
hide(options?: AnimationOptions): Promise<void>;
/**
* Get info about the current state of the status bar.
*
* @since 1.0.0
*/
getInfo(): Promise<StatusBarInfo>;
/**
* Set whether or not the status bar should overlay the webview to allow usage
* of the space underneath it.
* Not available on Android 15+.
*
* @since 1.0.0
*/
setOverlaysWebView(options: SetOverlaysWebViewOptions): Promise<void>;
/**
* Listen for status bar visibility changes.
* Fired when hide or show methods get called.
*
* @since 7.0.0
*/
addListener(eventName: 'statusBarVisibilityChanged', listenerFunc: VisibilityChangeListener): Promise<PluginListenerHandle>;
/**
* Listen for status bar overlay changes.
* Fired when setOverlaysWebView gets called.
*
* @since 7.0.0
*/
addListener(eventName: 'statusBarOverlayChanged', listenerFunc: OverlayChangeListener): Promise<PluginListenerHandle>;
}
/**
* @deprecated Use `StyleOptions`.
* @since 1.0.0
*/
export type StatusBarStyleOptions = StyleOptions;
/**
* @deprecated Use `BackgroundColorOptions`.
* @since 1.0.0
*/
export type StatusBarBackgroundColorOptions = BackgroundColorOptions;
/**
* @deprecated Use `SetOverlaysWebViewOptions`.
* @since 1.0.0
*/
export type StatusBarOverlaysWebviewOptions = SetOverlaysWebViewOptions;
/**
* @deprecated Use `StatusBarInfo`.
* @since 1.0.0
*/
export type StatusBarInfoResult = StatusBarInfo;
/**
* @deprecated Use `AnimationOptions`.
* @since 1.0.0
*/
export type StatusBarAnimationOptions = AnimationOptions;
/**
* @deprecated Use `Animation`.
* @since 1.0.0
*/
export declare const StatusBarAnimation: typeof Animation;
/**
* @deprecated Use `Style`.
* @since 1.0.0
*/
export declare const StatusBarStyle: typeof Style;

View file

@ -0,0 +1,59 @@
/// <reference types="@capacitor/cli" />
export var Style;
(function (Style) {
/**
* Light text for dark backgrounds.
*
* @since 1.0.0
*/
Style["Dark"] = "DARK";
/**
* Dark text for light backgrounds.
*
* @since 1.0.0
*/
Style["Light"] = "LIGHT";
/**
* The style is based on the device appearance.
* If the device is using Dark mode, the statusbar text will be light.
* If the device is using Light mode, the statusbar text will be dark.
*
* @since 1.0.0
*/
Style["Default"] = "DEFAULT";
})(Style || (Style = {}));
export var Animation;
(function (Animation) {
/**
* No animation during show/hide.
*
* @since 1.0.0
*/
Animation["None"] = "NONE";
/**
* Slide animation during show/hide.
* It doesn't work on iOS 15+.
*
* @deprecated Use Animation.Fade or Animation.None instead.
*
* @since 1.0.0
*/
Animation["Slide"] = "SLIDE";
/**
* Fade animation during show/hide.
*
* @since 1.0.0
*/
Animation["Fade"] = "FADE";
})(Animation || (Animation = {}));
/**
* @deprecated Use `Animation`.
* @since 1.0.0
*/
export const StatusBarAnimation = Animation;
/**
* @deprecated Use `Style`.
* @since 1.0.0
*/
export const StatusBarStyle = Style;
//# sourceMappingURL=definitions.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,4 @@
import type { StatusBarPlugin } from './definitions';
declare const StatusBar: StatusBarPlugin;
export * from './definitions';
export { StatusBar };

5
node_modules/@capacitor/status-bar/dist/esm/index.js generated vendored Normal file
View file

@ -0,0 +1,5 @@
import { registerPlugin } from '@capacitor/core';
const StatusBar = registerPlugin('StatusBar');
export * from './definitions';
export { StatusBar };
//# sourceMappingURL=index.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,SAAS,GAAG,cAAc,CAAkB,WAAW,CAAC,CAAC;AAE/D,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { StatusBarPlugin } from './definitions';\n\nconst StatusBar = registerPlugin<StatusBarPlugin>('StatusBar');\n\nexport * from './definitions';\nexport { StatusBar };\n"]}

69
node_modules/@capacitor/status-bar/dist/plugin.cjs.js generated vendored Normal file
View file

@ -0,0 +1,69 @@
'use strict';
var core = require('@capacitor/core');
/// <reference types="@capacitor/cli" />
exports.Style = void 0;
(function (Style) {
/**
* Light text for dark backgrounds.
*
* @since 1.0.0
*/
Style["Dark"] = "DARK";
/**
* Dark text for light backgrounds.
*
* @since 1.0.0
*/
Style["Light"] = "LIGHT";
/**
* The style is based on the device appearance.
* If the device is using Dark mode, the statusbar text will be light.
* If the device is using Light mode, the statusbar text will be dark.
*
* @since 1.0.0
*/
Style["Default"] = "DEFAULT";
})(exports.Style || (exports.Style = {}));
exports.Animation = void 0;
(function (Animation) {
/**
* No animation during show/hide.
*
* @since 1.0.0
*/
Animation["None"] = "NONE";
/**
* Slide animation during show/hide.
* It doesn't work on iOS 15+.
*
* @deprecated Use Animation.Fade or Animation.None instead.
*
* @since 1.0.0
*/
Animation["Slide"] = "SLIDE";
/**
* Fade animation during show/hide.
*
* @since 1.0.0
*/
Animation["Fade"] = "FADE";
})(exports.Animation || (exports.Animation = {}));
/**
* @deprecated Use `Animation`.
* @since 1.0.0
*/
const StatusBarAnimation = exports.Animation;
/**
* @deprecated Use `Style`.
* @since 1.0.0
*/
const StatusBarStyle = exports.Style;
const StatusBar = core.registerPlugin('StatusBar');
exports.StatusBar = StatusBar;
exports.StatusBarAnimation = StatusBarAnimation;
exports.StatusBarStyle = StatusBarStyle;
//# sourceMappingURL=plugin.cjs.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js"],"sourcesContent":["/// <reference types=\"@capacitor/cli\" />\nexport var Style;\n(function (Style) {\n /**\n * Light text for dark backgrounds.\n *\n * @since 1.0.0\n */\n Style[\"Dark\"] = \"DARK\";\n /**\n * Dark text for light backgrounds.\n *\n * @since 1.0.0\n */\n Style[\"Light\"] = \"LIGHT\";\n /**\n * The style is based on the device appearance.\n * If the device is using Dark mode, the statusbar text will be light.\n * If the device is using Light mode, the statusbar text will be dark.\n *\n * @since 1.0.0\n */\n Style[\"Default\"] = \"DEFAULT\";\n})(Style || (Style = {}));\nexport var Animation;\n(function (Animation) {\n /**\n * No animation during show/hide.\n *\n * @since 1.0.0\n */\n Animation[\"None\"] = \"NONE\";\n /**\n * Slide animation during show/hide.\n * It doesn't work on iOS 15+.\n *\n * @deprecated Use Animation.Fade or Animation.None instead.\n *\n * @since 1.0.0\n */\n Animation[\"Slide\"] = \"SLIDE\";\n /**\n * Fade animation during show/hide.\n *\n * @since 1.0.0\n */\n Animation[\"Fade\"] = \"FADE\";\n})(Animation || (Animation = {}));\n/**\n * @deprecated Use `Animation`.\n * @since 1.0.0\n */\nexport const StatusBarAnimation = Animation;\n/**\n * @deprecated Use `Style`.\n * @since 1.0.0\n */\nexport const StatusBarStyle = Style;\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst StatusBar = registerPlugin('StatusBar');\nexport * from './definitions';\nexport { StatusBar };\n//# sourceMappingURL=index.js.map"],"names":["Style","Animation","registerPlugin"],"mappings":";;;;AAAA;AACWA;AACX,CAAC,UAAU,KAAK,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;AAC1B;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC,SAAS,CAAC,GAAG,SAAS;AAChC,CAAC,EAAEA,aAAK,KAAKA,aAAK,GAAG,EAAE,CAAC,CAAC;AACdC;AACX,CAAC,UAAU,SAAS,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO;AAChC;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM;AAC9B,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;AACjC;AACA;AACA;AACA;AACY,MAAC,kBAAkB,GAAGA;AAClC;AACA;AACA;AACA;AACY,MAAC,cAAc,GAAGD;;ACxDzB,MAAC,SAAS,GAAGE,mBAAc,CAAC,WAAW;;;;;;"}

72
node_modules/@capacitor/status-bar/dist/plugin.js generated vendored Normal file
View file

@ -0,0 +1,72 @@
var capacitorStatusBar = (function (exports, core) {
'use strict';
/// <reference types="@capacitor/cli" />
exports.Style = void 0;
(function (Style) {
/**
* Light text for dark backgrounds.
*
* @since 1.0.0
*/
Style["Dark"] = "DARK";
/**
* Dark text for light backgrounds.
*
* @since 1.0.0
*/
Style["Light"] = "LIGHT";
/**
* The style is based on the device appearance.
* If the device is using Dark mode, the statusbar text will be light.
* If the device is using Light mode, the statusbar text will be dark.
*
* @since 1.0.0
*/
Style["Default"] = "DEFAULT";
})(exports.Style || (exports.Style = {}));
exports.Animation = void 0;
(function (Animation) {
/**
* No animation during show/hide.
*
* @since 1.0.0
*/
Animation["None"] = "NONE";
/**
* Slide animation during show/hide.
* It doesn't work on iOS 15+.
*
* @deprecated Use Animation.Fade or Animation.None instead.
*
* @since 1.0.0
*/
Animation["Slide"] = "SLIDE";
/**
* Fade animation during show/hide.
*
* @since 1.0.0
*/
Animation["Fade"] = "FADE";
})(exports.Animation || (exports.Animation = {}));
/**
* @deprecated Use `Animation`.
* @since 1.0.0
*/
const StatusBarAnimation = exports.Animation;
/**
* @deprecated Use `Style`.
* @since 1.0.0
*/
const StatusBarStyle = exports.Style;
const StatusBar = core.registerPlugin('StatusBar');
exports.StatusBar = StatusBar;
exports.StatusBarAnimation = StatusBarAnimation;
exports.StatusBarStyle = StatusBarStyle;
return exports;
})({}, capacitorExports);
//# sourceMappingURL=plugin.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js"],"sourcesContent":["/// <reference types=\"@capacitor/cli\" />\nexport var Style;\n(function (Style) {\n /**\n * Light text for dark backgrounds.\n *\n * @since 1.0.0\n */\n Style[\"Dark\"] = \"DARK\";\n /**\n * Dark text for light backgrounds.\n *\n * @since 1.0.0\n */\n Style[\"Light\"] = \"LIGHT\";\n /**\n * The style is based on the device appearance.\n * If the device is using Dark mode, the statusbar text will be light.\n * If the device is using Light mode, the statusbar text will be dark.\n *\n * @since 1.0.0\n */\n Style[\"Default\"] = \"DEFAULT\";\n})(Style || (Style = {}));\nexport var Animation;\n(function (Animation) {\n /**\n * No animation during show/hide.\n *\n * @since 1.0.0\n */\n Animation[\"None\"] = \"NONE\";\n /**\n * Slide animation during show/hide.\n * It doesn't work on iOS 15+.\n *\n * @deprecated Use Animation.Fade or Animation.None instead.\n *\n * @since 1.0.0\n */\n Animation[\"Slide\"] = \"SLIDE\";\n /**\n * Fade animation during show/hide.\n *\n * @since 1.0.0\n */\n Animation[\"Fade\"] = \"FADE\";\n})(Animation || (Animation = {}));\n/**\n * @deprecated Use `Animation`.\n * @since 1.0.0\n */\nexport const StatusBarAnimation = Animation;\n/**\n * @deprecated Use `Style`.\n * @since 1.0.0\n */\nexport const StatusBarStyle = Style;\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst StatusBar = registerPlugin('StatusBar');\nexport * from './definitions';\nexport { StatusBar };\n//# sourceMappingURL=index.js.map"],"names":["Style","Animation","registerPlugin"],"mappings":";;;IAAA;AACWA;IACX,CAAC,UAAU,KAAK,EAAE;IAClB;IACA;IACA;IACA;IACA;IACA,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAC1B;IACA;IACA;IACA;IACA;IACA,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,KAAK,CAAC,SAAS,CAAC,GAAG,SAAS;IAChC,CAAC,EAAEA,aAAK,KAAKA,aAAK,GAAG,EAAE,CAAC,CAAC;AACdC;IACX,CAAC,UAAU,SAAS,EAAE;IACtB;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM;IAC9B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO;IAChC;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM;IAC9B,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;IACjC;IACA;IACA;IACA;AACY,UAAC,kBAAkB,GAAGA;IAClC;IACA;IACA;IACA;AACY,UAAC,cAAc,GAAGD;;ACxDzB,UAAC,SAAS,GAAGE,mBAAc,CAAC,WAAW;;;;;;;;;;;;"}

View file

@ -0,0 +1,168 @@
import Foundation
import Capacitor
public class StatusBar {
private var bridge: CAPBridgeProtocol
private var isOverlayingWebview = true
private var backgroundColor = UIColor.black
private var backgroundView: UIView?
private var observers: [NSObjectProtocol] = []
init(bridge: CAPBridgeProtocol, config: StatusBarConfig) {
self.bridge = bridge
setupObservers(with: config)
}
deinit {
observers.forEach { NotificationCenter.default.removeObserver($0) }
}
private func setupObservers(with config: StatusBarConfig) {
observers.append(NotificationCenter.default.addObserver(forName: .capacitorViewDidAppear, object: .none, queue: .none) { [weak self] _ in
self?.handleViewDidAppear(config: config)
})
observers.append(NotificationCenter.default.addObserver(forName: .capacitorStatusBarTapped, object: .none, queue: .none) { [weak self] _ in
self?.bridge.triggerJSEvent(eventName: "statusTap", target: "window")
})
observers.append(NotificationCenter.default.addObserver(forName: .capacitorViewWillTransition, object: .none, queue: .none) { [weak self] _ in
self?.handleViewWillTransition()
})
}
private func handleViewDidAppear(config: StatusBarConfig) {
setStyle(config.style)
setBackgroundColor(config.backgroundColor)
setOverlaysWebView(config.overlaysWebView)
}
private func handleViewWillTransition() {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
self?.resizeStatusBarBackgroundView()
self?.resizeWebView()
}
}
func setStyle(_ style: UIStatusBarStyle) {
bridge.statusBarStyle = style
}
func setBackgroundColor(_ color: UIColor) {
backgroundColor = color
backgroundView?.backgroundColor = color
}
func setAnimation(_ animation: String) {
if animation == "SLIDE" {
bridge.statusBarAnimation = .slide
} else if animation == "NONE" {
bridge.statusBarAnimation = .none
} else {
bridge.statusBarAnimation = .fade
}
}
func hide(animation: String) {
setAnimation(animation)
if bridge.statusBarVisible {
bridge.statusBarVisible = false
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
self?.resizeWebView()
self?.backgroundView?.removeFromSuperview()
self?.backgroundView?.isHidden = true
}
}
}
func show(animation: String) {
setAnimation(animation)
if !bridge.statusBarVisible {
bridge.statusBarVisible = true
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [self] in
resizeWebView()
if !isOverlayingWebview {
resizeStatusBarBackgroundView()
bridge.webView?.superview?.addSubview(backgroundView!)
}
backgroundView?.isHidden = false
}
}
}
func getInfo() -> StatusBarInfo {
let style: String
switch bridge.statusBarStyle {
case .default:
style = "DEFAULT"
case .lightContent:
style = "DARK"
case .darkContent:
style = "LIGHT"
@unknown default:
style = "DEFAULT"
}
return StatusBarInfo(
overlays: isOverlayingWebview,
visible: bridge.statusBarVisible,
style: style,
color: UIColor.capacitor.hex(fromColor: backgroundColor),
height: getStatusBarFrame().size.height
)
}
func setOverlaysWebView(_ overlay: Bool) {
if overlay == isOverlayingWebview { return }
isOverlayingWebview = overlay
if overlay {
backgroundView?.removeFromSuperview()
} else {
initializeBackgroundViewIfNeeded()
bridge.webView?.superview?.addSubview(backgroundView!)
}
resizeWebView()
}
private func resizeWebView() {
let bounds: CGRect? = bridge.viewController?.view.window?.windowScene?.keyWindow?.bounds
guard
let webView = bridge.webView,
let bounds = bounds
else { return }
bridge.viewController?.view.frame = bounds
webView.frame = bounds
let statusBarHeight = getStatusBarFrame().size.height
var webViewFrame = webView.frame
if isOverlayingWebview {
let safeAreaTop = webView.safeAreaInsets.top
if statusBarHeight >= safeAreaTop && safeAreaTop > 0 {
webViewFrame.origin.y = safeAreaTop == 40 ? 20 : statusBarHeight - safeAreaTop
} else {
webViewFrame.origin.y = 0
}
} else {
webViewFrame.origin.y = statusBarHeight
}
webViewFrame.size.height -= webViewFrame.origin.y
webView.frame = webViewFrame
}
private func resizeStatusBarBackgroundView() {
backgroundView?.frame = getStatusBarFrame()
}
private func getStatusBarFrame() -> CGRect {
return bridge.viewController?.view.window?.windowScene?.statusBarManager?.statusBarFrame ?? .zero
}
private func initializeBackgroundViewIfNeeded() {
if backgroundView == nil {
backgroundView = UIView(frame: getStatusBarFrame())
backgroundView!.backgroundColor = backgroundColor
backgroundView!.autoresizingMask = [.flexibleWidth, .flexibleBottomMargin]
backgroundView!.isHidden = !bridge.statusBarVisible
}
}
}

View file

@ -0,0 +1,7 @@
import UIKit
public struct StatusBarConfig {
var overlaysWebView = true
var backgroundColor: UIColor = .black
var style: UIStatusBarStyle = .default
}

View file

@ -0,0 +1,9 @@
import Foundation
public struct StatusBarInfo {
public var overlays: Bool?
public var visible: Bool?
public var style: String?
public var color: String?
public var height: CGFloat?
}

View file

@ -0,0 +1,134 @@
import Foundation
import Capacitor
/**
* StatusBar plugin. Requires "View controller-based status bar appearance" to
* be "YES" in Info.plist
*/
@objc(StatusBarPlugin)
public class StatusBarPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "StatusBarPlugin"
public let jsName = "StatusBar"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "setStyle", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "setBackgroundColor", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "show", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "hide", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "getInfo", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "setOverlaysWebView", returnType: CAPPluginReturnPromise)
]
private var statusBar: StatusBar?
private let statusBarVisibilityChanged = "statusBarVisibilityChanged"
private let statusBarOverlayChanged = "statusBarOverlayChanged"
override public func load() {
guard let bridge = bridge else { return }
statusBar = StatusBar(bridge: bridge, config: statusBarConfig())
}
private func statusBarConfig() -> StatusBarConfig {
var config = StatusBarConfig()
config.overlaysWebView = getConfig().getBoolean("overlaysWebView", config.overlaysWebView)
if let colorConfig = getConfig().getString("backgroundColor"), let color = UIColor.capacitor.color(fromHex: colorConfig) {
config.backgroundColor = color
}
if let configStyle = getConfig().getString("style") {
config.style = style(fromString: configStyle)
}
return config
}
private func style(fromString: String) -> UIStatusBarStyle {
switch fromString.lowercased() {
case "dark", "lightcontent":
return .lightContent
case "light", "darkcontent":
return .darkContent
case "default":
return .default
default:
return .default
}
}
@objc func setStyle(_ call: CAPPluginCall) {
let options = call.options!
if let styleString = options["style"] as? String {
statusBar?.setStyle(style(fromString: styleString))
}
call.resolve([:])
}
@objc func setBackgroundColor(_ call: CAPPluginCall) {
guard
let hexString = call.options["color"] as? String,
let color = UIColor.capacitor.color(fromHex: hexString)
else { return }
DispatchQueue.main.async { [weak self] in
self?.statusBar?.setBackgroundColor(color)
}
call.resolve()
}
@objc func hide(_ call: CAPPluginCall) {
let animation = call.getString("animation", "FADE")
DispatchQueue.main.async { [weak self] in
self?.statusBar?.hide(animation: animation)
guard
let info = self?.statusBar?.getInfo(),
let dict = self?.toDict(info),
let event = self?.statusBarVisibilityChanged
else { return }
self?.notifyListeners(event, data: dict)
}
call.resolve()
}
@objc func show(_ call: CAPPluginCall) {
let animation = call.getString("animation", "FADE")
DispatchQueue.main.async { [weak self] in
self?.statusBar?.show(animation: animation)
guard
let info = self?.statusBar?.getInfo(),
let dict = self?.toDict(info),
let event = self?.statusBarVisibilityChanged
else { return }
self?.notifyListeners(event, data: dict)
}
call.resolve()
}
@objc func getInfo(_ call: CAPPluginCall) {
DispatchQueue.main.async { [weak self] in
guard
let info = self?.statusBar?.getInfo(),
let dict = self?.toDict(info)
else { return }
call.resolve(dict)
}
}
@objc func setOverlaysWebView(_ call: CAPPluginCall) {
guard let overlay = call.options["overlay"] as? Bool else { return }
DispatchQueue.main.async { [weak self] in
self?.statusBar?.setOverlaysWebView(overlay)
guard
let info = self?.statusBar?.getInfo(),
let dict = self?.toDict(info),
let event = self?.statusBarOverlayChanged
else { return }
self?.notifyListeners(event, data: dict)
}
call.resolve()
}
private func toDict(_ info: StatusBarInfo) -> [String: Any] {
return [
"visible": info.visible!,
"style": info.style!,
"color": info.color!,
"overlays": info.overlays!,
"height": info.height!
]
}
}

View file

@ -0,0 +1,40 @@
import Capacitor
public extension CapacitorExtensionTypeWrapper where T: UIColor {
static func hex(fromColor: UIColor) -> String? {
var red: CGFloat = 0
var green: CGFloat = 0
var blue: CGFloat = 0
var alpha: CGFloat = 0
guard fromColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha) else {
assertionFailure("Failed to get RGBA components from UIColor")
return nil
}
red = max(0, min(1, red))
green = max(0, min(1, green))
blue = max(0, min(1, blue))
alpha = max(0, min(1, alpha))
if alpha == 1 {
// RGB
return String(
format: "#%02lX%02lX%02lX",
Int(round(red * 255)),
Int(round(green * 255)),
Int(round(blue * 255))
)
} else {
// RGBA
return String(
format: "#%02lX%02lX%02lX%02lX",
Int(round(red * 255)),
Int(round(green * 255)),
Int(round(blue * 255)),
Int(round(alpha * 255))
)
}
}
}

View file

@ -0,0 +1,12 @@
import XCTest
@testable import StatusBarPlugin
final class StatusBarPluginTests: XCTestCase {
func testExample() throws {
// XCTest Documentation
// https://developer.apple.com/documentation/xctest
// Defining Test Cases and Test Methods
// https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods
}
}

86
node_modules/@capacitor/status-bar/package.json generated vendored Normal file
View file

@ -0,0 +1,86 @@
{
"name": "@capacitor/status-bar",
"version": "8.0.2",
"description": "The StatusBar API Provides methods for configuring the style of the Status Bar, along with showing or hiding it.",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"unpkg": "dist/plugin.js",
"files": [
"android/src/main/",
"android/build.gradle",
"dist/",
"ios/Sources",
"ios/Tests",
"Package.swift",
"CapacitorStatusBar.podspec"
],
"author": "Ionic <hi@ionicframework.com>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/ionic-team/capacitor-plugins.git"
},
"bugs": {
"url": "https://github.com/ionic-team/capacitor-plugins/issues"
},
"keywords": [
"capacitor",
"plugin",
"native"
],
"scripts": {
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
"verify:ios": "xcodebuild build -scheme CapacitorStatusBar -destination generic/platform=iOS",
"verify:android": "cd android && ./gradlew clean build test && cd ..",
"verify:web": "npm run build",
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
"eslint": "eslint . --ext ts",
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
"swiftlint": "node-swiftlint",
"docgen": "docgen --api StatusBarPlugin --output-readme README.md --output-json dist/docs.json",
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
"clean": "rimraf ./dist",
"watch": "tsc --watch",
"prepublishOnly": "npm run build",
"publish:cocoapod": "pod trunk push ./CapacitorStatusBar.podspec --allow-warnings"
},
"devDependencies": {
"@capacitor/android": "^8.0.0",
"@capacitor/cli": "^8.0.0",
"@capacitor/core": "^8.0.0",
"@capacitor/docgen": "0.3.0",
"@capacitor/ios": "^8.0.0",
"@ionic/eslint-config": "^0.4.0",
"@ionic/prettier-config": "^4.0.0",
"@ionic/swiftlint-config": "^2.0.0",
"eslint": "^8.57.1",
"prettier": "^3.6.2",
"prettier-plugin-java": "^2.7.7",
"rimraf": "^6.1.0",
"rollup": "^4.53.2",
"swiftlint": "^2.0.0",
"typescript": "^5.9.3"
},
"peerDependencies": {
"@capacitor/core": ">=8.0.0"
},
"prettier": "@ionic/prettier-config",
"swiftlint": "@ionic/swiftlint-config",
"eslintConfig": {
"extends": "@ionic/eslint-config/recommended"
},
"capacitor": {
"ios": {
"src": "ios"
},
"android": {
"src": "android"
}
},
"publishConfig": {
"access": "public"
},
"gitHead": "3678f5063762e8d9857ddb4f41aae5f65ead91fa"
}