Skip to content

fix: support themed Android system navigation bars - #85

Merged
originalix merged 8 commits into
mainfrom
codex/rn-0.86-compat
Aug 31, 2026
Merged

fix: support themed Android system navigation bars#85
originalix merged 8 commits into
mainfrom
codex/rn-0.86-compat

Conversation

@huhuanming

@huhuanming huhuanming commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose setNavigationBarAppearance(r, g, b, a, useDarkIcons) from react-native-device-utils
  • update the current Android Activity navigation bar color and icon appearance on the UI thread
  • reapply the last requested appearance when the Activity resumes
  • keep iOS as a no-op so consumers can use one cross-platform API

Android behavior

  • Android 15+: keep the platform navigation bar transparent and draw a reusable protection view only behind three-button navigation
    • handle bottom, left, and right navigation-bar positions across rotation
    • remove the protection area in gesture mode and restore it when three-button mode returns
  • Android 10–14: set navigationBarColor directly and disable enforced contrast
  • Android 8–9: set navigationBarColor and navigation icon appearance through AndroidX compatibility APIs
  • Android 7 / API 24–25: use an opaque black navigation bar when dark icons are requested because the platform cannot render dark navigation icons

Runtime scope

This API belongs to the Android main/UI runtime and updates the current Activity Window. It must not be called from the isolated background runtime.

Release and integration

Validation

  • package typecheck passed
  • Android compileDebugKotlin --rerun-tasks passed
  • Android lintDebug passed
  • example APK built and installed successfully
  • Android 15 / API 35 visual verification passed:
    • light and dark appearances in three-button mode
    • portrait, landscape-left, landscape-right, and upside-down rotations
    • three-button to gesture to three-button transitions without a gesture-mode protection strip
  • Android 7 / API 24 visual verification passed:
    • a light-background/dark-icon request falls back to a black bar with readable light icons
  • app-monorepo Android 15 integration verification passed:
    • light theme rendered a light navigation background with dark buttons
    • switching system/app theme to dark cleared LIGHT_NAVIGATION_BARS
  • git diff --check passed
  • GitHub checks are green

@socket-security

socket-security Bot commented Aug 26, 2026

Copy link
Copy Markdown

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

Comment thread native-modules/react-native-background-thread/package.json Outdated
@huhuanming

Copy link
Copy Markdown
Contributor Author

Addressed both P1 findings from the automated review in commit 6c570ab:

  • Regenerated example/react-native/ios/Podfile.lock so all local pods and spec checksums match version 3.0.90.
  • Updated scripts/setup-nitro-module.js to resolve Hermes from hermes-compiler/package.json and use hermesc/%OS-BIN%/hermesc, matching React Native 0.86.

Validation completed:

  • bundle exec pod install --deployment: passed with no lockfile changes
  • BackgroundThread iOS simulator scheme: build succeeded
  • Android example arm64-v8a debug APK: build succeeded
  • setup script syntax check and resolved Hermes compiler existence check: passed

The Socket obfuscated-code warning does not require a dependency change: @react-native/debugger-frontend 0.86.2 is an official React Native package sourced from facebook/react-native and is pinned transitively by @react-native/dev-middleware 0.86.2. The published debugger UI is bundled/minified, which is what triggers this heuristic; the package version and integrity are locked, so I am treating it as acceptable risk for this PR.

@huhuanming

Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore npm/@react-native/debugger-frontend@0.86.2

# Conflicts:
#	CHANGELOG.md
#	example/react-native/ios/Podfile.lock
#	native-modules/native-logger/package.json
#	native-modules/react-native-aes-crypto/package.json
#	native-modules/react-native-app-update/package.json
#	native-modules/react-native-async-storage/package.json
#	native-modules/react-native-background-thread/ios/BackgroundThreadManager.h
#	native-modules/react-native-background-thread/ios/BackgroundThreadManager.mm
#	native-modules/react-native-background-thread/package.json
#	native-modules/react-native-bundle-crypto/package.json
#	native-modules/react-native-bundle-update/package.json
#	native-modules/react-native-check-biometric-auth-changed/package.json
#	native-modules/react-native-cloud-fs/package.json
#	native-modules/react-native-cloud-kit-module/package.json
#	native-modules/react-native-device-utils/package.json
#	native-modules/react-native-dns-lookup/package.json
#	native-modules/react-native-get-random-values/package.json
#	native-modules/react-native-keychain-module/package.json
#	native-modules/react-native-lite-card/package.json
#	native-modules/react-native-network-info/package.json
#	native-modules/react-native-network-throttle/package.json
#	native-modules/react-native-pbkdf2/package.json
#	native-modules/react-native-perf-memory/package.json
#	native-modules/react-native-perf-stats/package.json
#	native-modules/react-native-ping/package.json
#	native-modules/react-native-range-downloader/package.json
#	native-modules/react-native-sni-connect/package.json
#	native-modules/react-native-splash-screen/package.json
#	native-modules/react-native-split-bundle-loader/package.json
#	native-modules/react-native-tcp-socket/package.json
#	native-modules/react-native-zip-archive/package.json
#	native-views/react-native-auto-size-input/package.json
#	native-views/react-native-chart-webview/package.json
#	native-views/react-native-pager-view/package.json
#	native-views/react-native-perp-depth-bar/package.json
#	native-views/react-native-scroll-guard/package.json
#	native-views/react-native-segment-slider/package.json
#	native-views/react-native-skeleton/package.json
#	native-views/react-native-tab-view/package.json
@huhuanming huhuanming changed the title chore: upgrade app modules to React Native 0.86 fix: support themed Android system navigation bars Aug 30, 2026
@originalix
originalix merged commit 4a05d99 into main Aug 31, 2026
4 checks passed
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.

2 participants