https://kotlinlang.org logo
Title
b

bodo

07/13/2020, 2:03 PM
Hi. I want to build a kind of master detail view when the screen is big enough. does anyone have experience using navigation component (single activity) with this layout. 1. how do i get the navController in both fragments 2. how is the xml layout lookin g (e.g. navController) 3. which structure would be best if we need some screens with/without toolbar and/or tablayout with viewpager • activity (with toolbar and or tablayout -> hide/show) -> masterFragment | detailFragment • activity -> containerfragment (with toolbar and or tablayout) -> masterFragment | detailFragment thanks for the help / discussion
f

Fatih

07/13/2020, 3:52 PM
These are very basic things NavComponent can achieve successfully. See the examples at https://github.com/android/architecture-components-samples
b

bodo

07/13/2020, 5:22 PM
Thanks @Fatih. But I am looking for master/details examples with the navigation component
f

Fatih

07/13/2020, 6:41 PM
It is pretty much same for all examples. You can access `navController`in any fragments by calling
findNAvController
extension function. So that means, you can navigate to any activity, fragment or even fragment dialog inside a fragment/activity using NavComponent