Skip to content

Commit 95681b7

Browse files
authored
docs(statusbar): Android 16+ behavior change for overlaysWebView and backgroundColor (#2441)
1 parent 21fd481 commit 95681b7

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

status-bar/README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ npm install @capacitor/status-bar
99
npx cap sync
1010
```
1111

12+
## Android 16+ behavior change
13+
14+
For apps targeting **Android 16 (API level 36)** and higher using **Capacitor 8**, the following Status Bar configuration options **no longer work**:
15+
16+
- `overlaysWebView`
17+
- `backgroundColor`
18+
19+
These options relied on the ability to opt out of Android’s **edge-to-edge** system UI behavior, which allowed apps to control how the status bar overlays and its background color.
20+
21+
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.
22+
Without that property, the application assumed `overlaysWebView` as always `true`.
23+
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)
24+
25+
Starting with **Android 16**, this opt-out is **no longer available**, and the behavior is enforced by the system.
26+
As a result, the `overlaysWebView` and `backgroundColor` configuration options no longer have any effect.
27+
1228
## iOS Note
1329

1430
This plugin requires "View controller-based status bar appearance"
@@ -57,11 +73,11 @@ const showStatusBar = async () => {
5773

5874
These config values are available:
5975

60-
| Prop | Type | Description | Default | Since |
61-
| --------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----- |
62-
| **`overlaysWebView`** | <code>boolean</code> | Whether the statusbar is overlaid or not. For applications targeting Android 15, this property has no effect unless the property windowOptOutEdgeToEdgeEnforcement is added to the application layout file. Otherwise, the application assumes always overlays as true. More details in https://developer.android.com/reference/android/R.attr#windowOptOutEdgeToEdgeEnforcement | <code>true</code> | 1.0.0 |
63-
| **`style`** | <code>string</code> | <a href="#style">Style</a> of the text of the status bar. | <code>default</code> | 1.0.0 |
64-
| **`backgroundColor`** | <code>string</code> | Color of the background of the statusbar in hex format, #RRGGBB. Doesn't work if `overlaysWebView` is true. | <code>#000000</code> | 1.0.0 |
76+
| Prop | Type | Description | Default | Since |
77+
| --------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----- |
78+
| **`overlaysWebView`** | <code>boolean</code> | Whether the statusbar is overlaid or not. Not available on Android 15+. | <code>true</code> | 1.0.0 |
79+
| **`style`** | <code>string</code> | <a href="#style">Style</a> of the text of the status bar. | <code>default</code> | 1.0.0 |
80+
| **`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 |
6581

6682
### Examples
6783

@@ -143,6 +159,7 @@ setBackgroundColor(options: BackgroundColorOptions) => Promise<void>
143159
```
144160

145161
Set the background color of the status bar.
162+
Not available on Android 15+.
146163

147164
| Param | Type |
148165
| ------------- | ------------------------------------------------------------------------- |
@@ -214,6 +231,7 @@ setOverlaysWebView(options: SetOverlaysWebViewOptions) => Promise<void>
214231

215232
Set whether or not the status bar should overlay the webview to allow usage
216233
of the space underneath it.
234+
Not available on Android 15+.
217235

218236
| Param | Type |
219237
| ------------- | ------------------------------------------------------------------------------- |

status-bar/src/definitions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ declare module '@capacitor/cli' {
88
StatusBar?: {
99
/**
1010
* Whether the statusbar is overlaid or not.
11-
* For applications targeting Android 15, this property has no effect unless
12-
* the property windowOptOutEdgeToEdgeEnforcement is added to the application layout file.
13-
* Otherwise, the application assumes always overlays as true.
14-
* More details in https://developer.android.com/reference/android/R.attr#windowOptOutEdgeToEdgeEnforcement
11+
* Not available on Android 15+.
1512
*
1613
* @since 1.0.0
1714
* @default true
@@ -31,6 +28,7 @@ declare module '@capacitor/cli' {
3128
/**
3229
* Color of the background of the statusbar in hex format, #RRGGBB.
3330
* Doesn't work if `overlaysWebView` is true.
31+
* Not available on Android 15+.
3432
*
3533
* @since 1.0.0
3634
* @default #000000
@@ -172,6 +170,7 @@ export interface StatusBarPlugin {
172170

173171
/**
174172
* Set the background color of the status bar.
173+
* Not available on Android 15+.
175174
*
176175
* @since 1.0.0
177176
*/
@@ -205,6 +204,7 @@ export interface StatusBarPlugin {
205204
/**
206205
* Set whether or not the status bar should overlay the webview to allow usage
207206
* of the space underneath it.
207+
* Not available on Android 15+.
208208
*
209209
* @since 1.0.0
210210
*/

0 commit comments

Comments
 (0)