sunflower icon indicating copy to clipboard operation
sunflower copied to clipboard

Will you ever bring back master-detail tablet layout?

Open Zhuinden opened this issue 7 years ago • 11 comments

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?

Zhuinden avatar Jan 25 '19 00:01 Zhuinden

We have the same issue in googlesamples/android-architecture-components
https://github.com/googlesamples/android-architecture-components/issues/377

MarcusWolschon avatar Mar 27 '19 13:03 MarcusWolschon

I saw https://proandroiddev.com/master-detail-views-with-navigation-components-a20405f31974 and it makes sense.

Zhuinden avatar Mar 27 '19 13:03 Zhuinden

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)

MarcusWolschon avatar Mar 27 '19 13:03 MarcusWolschon

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 :(

danielwilson1702 avatar Apr 15 '19 12:04 danielwilson1702

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.

Zhuinden avatar Apr 15 '19 14:04 Zhuinden

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 avatar Apr 17 '19 23:04 danielwilson1702

@danielwilson1702 well I did test against config changes and also process death and it seems to be restoring back properly. Nice one. 😲

Zhuinden avatar Apr 18 '19 01:04 Zhuinden

Any news regarding this issue?

fklappan avatar Dec 12 '19 09:12 fklappan

Eagerly waiting ⌛

ananddamodaran avatar May 25 '20 07:05 ananddamodaran

https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/TwoPaneFragment.kt?q=abstractlistdetailfragment

Zhuinden avatar Oct 12 '22 20:10 Zhuinden

I only bloody saw they added this after I rewrote my implementation using SlidingPaneLayout 😆

danielwilson1702 avatar Oct 12 '22 21:10 danielwilson1702