what is the right way of making something like a page with multiple pages inside like viewPager and tab layouts , also how to handle the state of moving through them?
Esmaeel Nabil
08/28/2020, 4:02 PM
like should make it like
Activity {
Fragment1,
Fragment2,
Fragment3
} with tab layout
or their this something like the flutter way of doing it !
a
Afzal Najam
08/28/2020, 4:05 PM
If there isn't already a widget for it, I'm thinking you could do something like this:
Copy code
@Composable
fun MainScreen() {
val currentScreenState = remember { } // current screen here
Column {
renderCurrentScreen(currentScreenState)
Row {
renderTabs(currentScreenState)
}
}
}
Then use the currenScreenState for highlighting the tabs.
I think this might break down if there's deeper navigation in each tab though...or maybe it won't?
👍 1
e
Esmaeel Nabil
08/28/2020, 4:06 PM
i have seen libraries for it but before the alpha release, maybe there is something dedicated for that.