Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/android-route-active-tint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-native-bottom-tabs': patch
---

fix(android): apply per-route `activeTintColor` when switching tabs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) {
fun setSelectedItem(value: String) {
selectedItem = value
setSelectedIndex(items.indexOfFirst { it.key == value })
// Per-tab active tint color depends on the selected item.
updateTintColors()
}

override fun addView(child: View, index: Int, params: ViewGroup.LayoutParams?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,11 @@ class RCTTabViewManager(context: ReactApplicationContext) :
}

override fun setActiveTintColor(view: ReactBottomNavigationView?, value: Int?) {
if (view != null && value != null)
view.setActiveTintColor(value)
view?.setActiveTintColor(value)
}

override fun setInactiveTintColor(view: ReactBottomNavigationView?, value: Int?) {
if (view != null && value != null)
view.setInactiveTintColor(value)
view?.setInactiveTintColor(value)
}

override fun setExperimentalBakedTintColors(view: ReactBottomNavigationView?, value: Boolean) {
Expand Down
Loading