Skip to content

fix(android): apply per-route activeTintColor when switching tabs - #599

Merged
thiagobrez merged 1 commit into
callstack:mainfrom
rjmreis:fix/android-route-active-tint-color
Oct 20, 2026
Merged

thiagobrez merged 1 commit into
callstack:mainfrom
rjmreis:fix/android-route-active-tint-color

Conversation

@rjmreis

@rjmreis rjmreis commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

PR Description

Bug fix. On Android, activeTintColor set on a route (or tabBarActiveTintColor in a React Navigation screen's options) was ignored after switching tabs. The selected tab kept the colour it had when the tab bar mounted, which is usually the global tabBarActiveTintColor.

Root cause: ReactBottomNavigationView only recomputed the tint colours when the items prop changed. A tab switch only changes selectedPage, and React's prop diffing doesn't send items again when its contents haven't changed. So updateTintColors() never ran with the newly selected item.

Changes:

  • RCTTabView.kt: setSelectedItem now calls updateTintColors(), so the selected route's activeTintColor is applied on every tab switch, falling back to the global colour.
  • RCTTabViewManager.kt: null values for activeTintColor/inactiveTintColor are now passed through, so clearing the global prop resets to the theme default instead of keeping the previous colour.

Both the standalone and React Navigation adapters use the same native path, so this fixes both. iOS already handled per-route colours correctly, so it's unchanged.

How to test?

  1. Run the example app on Android and open Tint Colors. The global colour is red; Albums has purple and Contacts has blue.
  2. Switch between tabs:
    • Contacts: icon and label should be blue.
    • Albums: label should be purple. Its icon uses iconRenderingMode: 'original', so only the label is tinted.
    • Article and Chat should use the global red.
  3. Before this change, every selected tab showed red.

Note: the Native Bottom Tabs (React Navigation) example currently crashes on main with "Couldn't find a theme" for me after a fresh install, which looks like duplicate @react-navigation/native copies in the workspace. That's unrelated to this change, so I verified the fix with the standalone example.

Screenshots

Before / after on an Android emulator (API 37):

activeTintColor_android_before_after.mp4

The selected item's tint was only recomputed when `items` changed. Tab
switches only update `selectedPage`, and React's prop diffing skips
`items` when its contents are unchanged, so a route's own
`activeTintColor` was never applied after switching tabs.

Recompute tint colors on selection change, and allow clearing the
global active/inactive tint colors.
@rjmreis
rjmreis force-pushed the fix/android-route-active-tint-color branch from 9b54e92 to 757d3e8 Compare October 15, 2026 11:20
@thiagobrez
thiagobrez added this pull request to the merge queue Oct 20, 2026
Merged via the queue into callstack:main with commit a96669e Oct 20, 2026
6 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