fix(connect): theme the Android account onboarding navigation bar from the appearance by asendra-stripe · Pull Request #2723 · stripe/stripe-react-native · GitHub
Skip to content

fix(connect): theme the Android account onboarding navigation bar from the appearance - #2723

Open
asendra-stripe wants to merge 2 commits into
masterfrom
asendra/connect-android-navbar-appearance
Open

asendra-stripe wants to merge 2 commits into
masterfrom
asendra/connect-android-navbar-appearance

Conversation

@asendra-stripe

@asendra-stripe asendra-stripe commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On Android, the ConnectAccountOnboarding navigation bar is always white with black text, and the area behind the status bar is white too. When the app uses a dark appearance, a white bar sits above a dark embedded component.

This change makes the bar follow the appearance, using only existing props:

  • ConnectAccountOnboarding passes the colorBackground appearance variable as the backgroundColor of the bar's style, and as the background of the safe area behind the status bar (the component body already used it).
  • The native bar now follows style.backgroundColor. Its toolbar draws its own background, which used to cover the one React Native applies, so the view manager forwards the color to the toolbar.
  • The title and close icon switch between black and white, whichever is more readable on that background.
  • Without a background color (the default), the bar is still white with black content.

There are no API changes: no new props, and the API report, the native spec and the NavigationBar wrapper are untouched.

This matches iOS, where the native bar's background is also the colorBackground appearance variable and the title and close button are not coloured from colorText either; they use the system colors, which are black in light mode and white in dark mode. Before this change nothing let an app set the Android title color, so choosing black or white by contrast removes no option.

NotificationBanner renders the same bar and could pass the same style. I did not change it because I could not exercise it.

Motivation

In dark mode the Android onboarding screen shows a white header and white status-bar area above a dark component, which looks broken compared with iOS. NavigationBarView.kt hardcodes Color.WHITE for the toolbar and Color.BLACK for the title and close icon, so apps cannot fix this through the appearance API.

Testing

  • I tested this manually
  • I added automated tests

Manually, on an Android API 37 emulator (Pixel 9a profile), with the change applied to stripe-react-native 0.79.0 in an app that sets the Connect appearance from its own light and dark themes:

  • Dark: the bar and the status-bar area are dark, the title and close icon are white, and the status-bar icons are readable.
  • Light: the bar is white with dark content.

Not tested: a real device, other Android versions, NotificationBanner, a background that is a mid-tone color, and a live theme change while the screen is open (the status-bar icons keep the style they had when the screen opened).

Automated: two Components tests check that, on Android, the bar's style gets the appearance background and falls back to white when the appearance sets none. Six Robolectric tests cover the black or white content choice. A deliberate break of each is caught. yarn test, yarn lint and tsc pass, and so do the Kotlin format and lint hooks. I ran the Robolectric tests through an app's Gradle project, not through yarn test:unit:android, which needs the example app's dependencies.

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

Added a CHANGELOG entry.

@asendra-stripe
asendra-stripe requested review from a team as code owners October 8, 2026 12:45
@tomchengcui-stripe

Copy link
Copy Markdown

Comment thread src/specs/NativeNavigationBar.ts Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we need to add more theming parameters to the dev interface? This can be solved by using existing ones no?

(adding more requires API review as noted by @torrance-stripe )
r? @asendra-stripe

@asendra-stripe asendra-stripe Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jorgea-stripe I reply on Slack but forgot to do it here. I have updated the PR to avoid modifying the public API. Let me know if that works for you!

asendra-stripe and others added 2 commits October 21, 2026 16:17
…m the appearance

On Android the account onboarding navigation bar was always white with black text, so in dark mode a white bar sat above a dark embedded component. The bar now takes its background from the colorBackground appearance variable and its title and close icon from colorText, and the area behind the status bar uses the background color too. Defaults are unchanged when the variables are not set.

Adds toolbarBackgroundColor and toolbarContentColor to the native NavigationBar. NotificationBanner uses the same bar and can adopt the new props.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Committed-By-Agent: claude
…bar color

Drops the new toolbarBackgroundColor and toolbarContentColor props, so the public API and its report are unchanged. The bar now takes its background from the backgroundColor of its style, which the native view manager passes on to the toolbar, and picks black or white content for contrast.

Committed-By-Agent: claude
@asendra-stripe
asendra-stripe force-pushed the asendra/connect-android-navbar-appearance branch from e228461 to a7b929b Compare October 21, 2026 14:17

This branch has not been deployed

No deployments
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.

3 participants