File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
packages/react-native-bottom-tabs
android/src/main/java/com/rcttabview Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " react-native-bottom-tabs " : patch
3+ ---
4+
5+ feat: support more than 6 screens on Android
Original file line number Diff line number Diff line change @@ -34,8 +34,14 @@ import com.google.android.material.navigation.NavigationBarView.LABEL_VISIBILITY
3434import com.google.android.material.navigation.NavigationBarView.LABEL_VISIBILITY_UNLABELED
3535import com.google.android.material.transition.platform.MaterialFadeThrough
3636
37+ class ExtendedBottomNavigationView (context : Context ) : BottomNavigationView(context) {
38+ override fun getMaxItemCount (): Int {
39+ return 100
40+ }
41+ }
42+
3743class ReactBottomNavigationView (context : Context ) : LinearLayout(context) {
38- private var bottomNavigation = BottomNavigationView (context)
44+ private var bottomNavigation = ExtendedBottomNavigationView (context)
3945 val layoutHolder = FrameLayout (context)
4046
4147 var onTabSelectedListener: ((key: String ) -> Unit )? = null
@@ -456,7 +462,7 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) {
456462 // React Native opts out ouf Activity re-creation when configuration changes, this workarounds that.
457463 // We also opt-out of this recreation when custom styles are used.
458464 removeView(bottomNavigation)
459- bottomNavigation = BottomNavigationView (context)
465+ bottomNavigation = ExtendedBottomNavigationView (context)
460466 addView(bottomNavigation)
461467 updateItems(items)
462468 setLabeled(this .labeled)
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ interface Props<Route extends BaseRoute> {
162162 } ;
163163}
164164
165- const ANDROID_MAX_TABS = 6 ;
165+ const ANDROID_MAX_TABS = 100 ;
166166
167167const TabView = < Route extends BaseRoute > ( {
168168 navigationState,
You can’t perform that action at this time.
0 commit comments