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
34
34
import com.google.android.material.navigation.NavigationBarView.LABEL_VISIBILITY_UNLABELED
35
35
import com.google.android.material.transition.platform.MaterialFadeThrough
36
36
37
+ class ExtendedBottomNavigationView (context : Context ) : BottomNavigationView(context) {
38
+ override fun getMaxItemCount (): Int {
39
+ return 100
40
+ }
41
+ }
42
+
37
43
class ReactBottomNavigationView (context : Context ) : LinearLayout(context) {
38
- private var bottomNavigation = BottomNavigationView (context)
44
+ private var bottomNavigation = ExtendedBottomNavigationView (context)
39
45
val layoutHolder = FrameLayout (context)
40
46
41
47
var onTabSelectedListener: ((key: String ) -> Unit )? = null
@@ -456,7 +462,7 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) {
456
462
// React Native opts out ouf Activity re-creation when configuration changes, this workarounds that.
457
463
// We also opt-out of this recreation when custom styles are used.
458
464
removeView(bottomNavigation)
459
- bottomNavigation = BottomNavigationView (context)
465
+ bottomNavigation = ExtendedBottomNavigationView (context)
460
466
addView(bottomNavigation)
461
467
updateItems(items)
462
468
setLabeled(this .labeled)
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ interface Props<Route extends BaseRoute> {
162
162
} ;
163
163
}
164
164
165
- const ANDROID_MAX_TABS = 6 ;
165
+ const ANDROID_MAX_TABS = 100 ;
166
166
167
167
const TabView = < Route extends BaseRoute > ( {
168
168
navigationState,
You can’t perform that action at this time.
0 commit comments