From 1dfcc279258d88997cff559ad8be1ffe72b7929a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Wed, 23 Apr 2025 11:18:58 -0700 Subject: [PATCH] fix: don't show default tab bar when channing theme and using a custom one --- .changeset/little-dingos-cough.md | 5 +++++ .../android/src/main/java/com/rcttabview/RCTTabView.kt | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/little-dingos-cough.md diff --git a/.changeset/little-dingos-cough.md b/.changeset/little-dingos-cough.md new file mode 100644 index 0000000..4384a40 --- /dev/null +++ b/.changeset/little-dingos-cough.md @@ -0,0 +1,5 @@ +--- +'react-native-bottom-tabs': patch +--- + +fix: don't show a default tab bar on top of a custom one when changing theme diff --git a/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt b/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt index 390579e..ab9b1dd 100644 --- a/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt +++ b/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt @@ -458,6 +458,11 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) { return } + // User has hidden the bottom navigation bar, don't re-attach it. + if (bottomNavigation.visibility == GONE) { + return + } + // If appearance wasn't changed re-create the bottom navigation view when configuration changes. // React Native opts out ouf Activity re-creation when configuration changes, this workarounds that. // We also opt-out of this recreation when custom styles are used.