Skip to content

fix(android): apply modern system bar appearance on Android 12+ - #81

Open
huxinhai wants to merge 1 commit into
kadiraydinli:mainfrom
huxinhai:agent/android-12-system-bar-appearance
Open

fix(android): apply modern system bar appearance on Android 12+#81
huxinhai wants to merge 1 commit into
kadiraydinli:mainfrom
huxinhai:agent/android-12-system-bar-appearance

Conversation

@huxinhai

Copy link
Copy Markdown

Closes #80

What changed

  • Use the platform WindowInsetsController.setSystemBarsAppearance API on Android 12+.
  • Preserve the existing WindowInsetsControllerCompat path on Android 11 and below.
  • Keep status, navigation, and both isolated through their respective appearance masks.

Why

On an affected Xiaomi Android 12 device, the window-backed compat controller could report light status-bar appearance as enabled while only the legacy systemUiVisibility flag had changed. SystemUI continued to consume the modern WindowManager appearance, so the status-bar icons returned to white after task removal and process restoration.

Calling the platform controller directly on API 31+ matches React Native's current Android status-bar implementation and updates the modern appearance consumed by SystemUI. There are no JavaScript API or default-value changes.

User impact

Apps using setBarStyle('dark', 'status') no longer lose dark status-bar icons during affected OEM task/process transitions.

Validation

  • Node 24.13.0 / Yarn 4.11.0
  • yarn install --immutable
  • yarn typecheck
  • yarn lint
  • yarn test — 2 suites, 44 tests
  • yarn prepare
  • :react-native-system-navigation-bar:compileDebugKotlin --rerun-tasks in the example app
  • :react-native-system-navigation-bar:assembleDebug in the example app
  • Downstream React Native 0.85 DogRelease build and install
  • Xiaomi Mi 10S, Android 12 / API 31: remove from recents, reopen, and process-restoration checks retained apr=LIGHT_STATUS_BARS; no Android or React Native fatal logs

The issue did not reproduce on the Android emulator; the before/after WindowManager evidence was captured on the physical Xiaomi device.

@huxinhai
huxinhai marked this pull request as ready for review August 18, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setBarStyle can miss modern status-bar appearance on Android 12+

1 participant