Hi, trying Voyager KMM library. Trying to implemen...
# multiplatform
r
Hi, trying Voyager KMM library. Trying to implement a SignInScreen that if successfull navigates to home screen where 3 tabs (home, profile, list_of_favorites) are displayed, list_of_favorites has to navigate to a detail screen. Can someone help me out to implement it? I've implemented the navigation to home screen, but unable to understand how to implement the tab+deep level navigation. Thanks in advance.
v
It is in the docs: https://voyager.adriel.cafe/navigation/tab-navigation You can have in the Tab Content another Navigator for in tab navigation
r
Yes, but its not compatible with Material3, bottom bar, bottombaritem, correct? Thanks
v
I don't think it cares at all what you have to draw UI
r
Material 3, Scaffold and BottomNavigation, BottomNavigationItem, are different. Reason of my doubt, can material3 components be used?
v
But the voyager doesn't have any dependencies to any of the ui elements you mentioned
Copy code
AppScaffold(
            bottomBar = {
                NavigationBar(
                    containerColor = AppTheme.colors.secondaryContainer
                ) {
                    state.chapters.forEach { chapter ->
                        TabNavigationItem(chapter)
                    }
                }
            },

            content = {
                CurrentTab()
            }
        )
r
It uses Material (2) components, import androidx.compose.material.BottomNavigation import androidx.compose.material.BottomNavigationItem import androidx.compose.material.Scaffold I'm using Material 3 components - Scaffold, BottomBar. First try compiler, gives error. I'm doing research haven't tried workarounds. Reason of my question,
v
Who it?
Voyager sample?
r
yes Voyager sample is in Material (2). I've Material 3 Components. The app is running (Registration + Home, Profile screen). I've Voyager running well, navigation from signin to HomeScreen. In Home screen i would like to have it in a tab+profile and settings. I'm trying to implement Tab+Navigator but i'm blocked, since don't have material libraries (have material 3, scaffold, bottombar, bottombar items). No idea if Voyager tab implementation, works, or not with Material 3 components.
v
Yes it works. The voyager doesn't care what you use on UI.
I showed the code on top with M3 scaffold and bottom nav bar.
r
@Vlad yes it works in Android. In iOS does not. Got the following There are still 3 unbound symbols after generation of IR module <shared>: Unbound public symbol IrSimpleFunctionPublicSymbolImpl: cafe.adriel.voyager.navigator.tab/Tab.icon.<get-icon>|-5764684600227404327[0] Unbound public symbol IrSimpleFunctionPublicSymbolImpl: cafe.adriel.voyager.navigator.tab/Tab.options.<get-options>|7766868889533212780[0] Unbound public symbol IrSimpleFunctionPublicSymbolImpl: cafe.adriel.voyager.navigator.tab/Tab.title.<get-title>|371973571756195065[0] This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies. related to the following line, Icon(painter = tap.options.icon!!
Copy code
NavigationBarItem(
    selected = tabNavigator.current == tab,
    onClick = { tabNavigator.current = tab },
    icon = {
        Icon(
            painter = tab.options.icon!!,

Any idea how to solve? 
Thanks.
        contentDescription = tab.options.title) },
Other issue i got is related to Scaffold (Material 3) topper. Content is not display. Related to windowInsets. Any idea how to solve? Decided to not used meanwhile. Concluding Material 3 is not stable, in particular Scaffold
m
hi, did you solved it? i have same problem
290 Views