Ahmed
10/16/2024, 10:31 AMAhmed
10/16/2024, 10:32 AMlistOf("Tab 1", "Tab 2", "Tab 3")
Which I am using for a TabRow
with a
HorizontalPager( .. ) { index ->
when (index) {
0 -> Tab1()
1 -> Tab2()
2 -> Tab3()
}
}
My question is regarding the list of tabs (name of tabs). Where would I keep the list? Would a new list be created on every recomposition? Do I need to remember the list?
Also, there's a special case where I need to omit Tab 1
. On that special case the result would look like
listOf("Tab 2", "Tab 3")
..
HorizontalPager( .. ) { index ->
when (index) {
0 -> Tab2()
1 -> Tab3()
}
}
Would a write a separate composable for this? What's the ideal way to deal with this? Would if-else be accepted?