Repository navigation
Description
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 8.6.2
@capacitor/core: 8.6.2
@capacitor/android: 8.6.2
@capacitor/ios: 8.6.2
Installed Dependencies:
@capacitor/ios: not installed
@capacitor/cli: 8.6.0
@capacitor/android: 8.6.0
@capacitor/core: 8.6.0
[success] Android looking great! 👌
Other API Details
npm 11.21.1, node v22.23.3
Default `npx cap add android` template: minSdk 24, compileSdk/targetSdk 36
Emulators: Android 16 (API 36, WebView 156) and Android 14 (API 34, WebView 157), both with 3-button navigation
Page: <meta name="viewport" content="viewport-fit=cover, ...">
No SystemBars config (default insetsHandling)Platforms Affected
- iOS
- Android
- Web
Current Behavior
With 3-button navigation, the navigation bar has no contrast scrim since @capacitor/android 8.5.2. Web content shows unprotected behind the back, home and recents buttons, so the buttons are hard to see on dark or busy content.
This happens:
- on Android 15+ in the default template;
- on Android 14 and older with
EdgeToEdge.enable(this), which the SystemBars docs recommend.
On Android 14 without edge-to-edge, the navigation bar also loses its normal opaque (black) background and shows the window background instead.
getWindow().isNavigationBarContrastEnforced() is true. Calling setNavigationBarContrastEnforced(true) or EdgeToEdge.enable(this, SystemBarStyle..., SystemBarStyle...) after super.onCreate() does not bring the scrim back.
| Setup (3-button navigation) | 8.5.1 | 8.6.0 |
|---|---|---|
| API 36, default template | scrim | no scrim |
API 36, EdgeToEdge.enable |
scrim | no scrim |
API 34, EdgeToEdge.enable |
scrim | no scrim |
| API 34, default template | black bar | light grey bar |
Cause: since #8535 (e37d9c6), SystemBars.initWindowInsetsListener() sets its OnApplyWindowInsetsListener on getWindow().getDecorView(); 8.5.1 set it on the WebView's parent. A listener is called instead of the view's own onApplyWindowInsets, and for the DecorView that is where the framework lays out the system bar backgrounds, including the navigation bar contrast scrim. From the View.OnApplyWindowInsetsListener reference: "The listener may optionally call the parameter View's onApplyWindowInsets method to apply the View's normal behavior as part of its own."
Expected Behavior
The 3-button navigation bar gets the translucent system scrim, as in 8.5.1 and as the Android edge-to-edge guide describes:
- "By default,
enableEdgeToEdge()makes the system bars transparent, except on 3-button navigation mode where the navigation bar gets a translucent scrim." - "Once your app targets SDK 35 … the three-button navigation bar is translucent."
Project Reproduction
https://github.com/adrenaline15/capacitor-systembars-scrim-repro
Additional Information
The repro README has the steps, including how to switch an emulator to 3-button navigation. The page prints env(safe-area-inset-*), --safe-area-inset-* and innerHeight.
A fix is in #8725: call the DecorView's own onApplyWindowInsets first and continue with the insets it returns, and apply SystemBars' padding to the WebView's parent instead of the DecorView, so the system bar backgrounds stay at the screen edges.
- With it, the navigation bar matches 8.5.1 in every tested case (API 36 and 34, with and without EdgeToEdge.enable, with and without viewport-fit=cover, keyboard open, landscape).
- The insets the page sees are unchanged.

Activity