Open Zhuinden opened 5 years ago
We have the same issue in googlesamples/android-architecture-components
https://github.com/googlesamples/android-architecture-components/issues/377
I saw https://proandroiddev.com/master-detail-views-with-navigation-components-a20405f31974 and it makes sense.
Looks great. Except I would use data binding and I would not choose one of 2 layouts in code when I could have both of them with the same name in /res/layout and /res/layou-sw300dp and let Android do the choosing. (as written in the "update" secion of that example)
I'm trying to implement this with tabs and it's pretty hard. If I want a master-detail layout for each tab the proandroiddev solution does not work so well because there's no easy way to fit it into a FragmentPagerAdapter :(
Each tab with a master detail layout?? I've never seen anything like that, can you send me a mockup? 😄
Even in Paint it's fine, I just need to see where the tabs are and where the master-detail comes in (and if it's orientation based or width based).
Especially if we are talking top tabs. This sounds curious.
Haha well I wrote a terrible article on what I managed to conjure up for posterity. You are right I hadn't considered how unusual what I was trying to do actually is. The app needs to display a lot of info from several lists, and will mostly be used on landscape tablets.
It's one job doing a master-detail layout, another doing tabs + nested fragments and quite another one trying to jam it into a navigation graph. Maybe what I've written down is of some use to future googlers.
@danielwilson1702 well I did test against config changes and also process death and it seems to be restoring back properly. Nice one. 😲
Any news regarding this issue?
Eagerly waiting ⌛
I only bloody saw they added this after I rewrote my implementation using SlidingPaneLayout 😆
I see that master detail was removed in https://github.com/googlesamples/android-sunflower/commit/7990334ad654fc9347dd9ba0e71761232da56678 and it's actually kinda sad because I was secretly hoping for the past 8 months that this will be that one sample that shows how to create a master-detail flow with Navigation AAC.
Is there any chance that this will be that one sample, or should I give up on my hopes and dreams regarding Nav AAC's ability to potentially model the option of showing multiple interdependent screens based on screen size?