Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Master/detail flow #99

Closed
pawelantczak opened this issue Jan 9, 2015 · 12 comments
Closed

Master/detail flow #99

pawelantczak opened this issue Jan 9, 2015 · 12 comments

Comments

@pawelantczak
Copy link

Hello.
Is there a possibility to use this lib with master/detail on tablets?
I want to have 2 panes in normal and 3 in existing multipane mode.
Thanks!

@neokree
Copy link
Owner

neokree commented Jan 10, 2015

Hi,
So you need to have a method for replacing your content on tablets and getting back to the first?
In the next release I will unprivate the setFragment method, so you could create your master/detail flow

@pawelantczak
Copy link
Author

Hi.
Thanks for setFragment.
With this, nested fragments come into play.

@mkosik
Copy link

mkosik commented Jan 12, 2015

Yup, making setFragment public will help also elsewhere - as mentioned in #39

@alessandrosilva
Copy link

Any predictions of when this feature (Master/Detail) will be available?

Congratulations for the great work. Helps a lot of our lives

@neokree
Copy link
Owner

neokree commented Jan 15, 2015

well, for the next release I'm working a lot. Because I want to make a stable release and fix all issues is not simple. Sometimes I'm gonna update the dev project for minor fix, so you can use that instead using maven, if you need this feature now

@neokree
Copy link
Owner

neokree commented Jan 18, 2015

I have released the 1.3 alpha to github. Actually I haven't test all new functionality and I'm working to create the example app, but now setFragment is public.

@tsuharesu
Copy link

Can you explain how the setFragment works?

@neokree
Copy link
Owner

neokree commented Jan 27, 2015

i'm writing the documentation in these days...

However, now there are three methods you can use.

setSection

The first is the setSection, that allows you to open a section programmatically.

setFragmentChild

The second is setFragmentChild, that have the target fragment and the title as parameters.

It replace the current content with the fragment, adding it into a stack.

When a child is opened, the toolbar menu change to the "back arrows" and if it is pressed, it returns to the primary section (or if user clicks on back button).

You can add how many child you want, for example:

  • Section 1 -> child 1 -> child 2
  • Section 2 -> child 1
  • etc.

setFragment

You can use this method as the setFragmentChild, but it is not added to the stack, and the fragment added is totally alone with the content. So the toolbar not change and if user clicks on the back button, it works as the section with the Drawer pattern you have used.

@tsuharesu
Copy link

Hmm, so the setFragmentChild will be used to go from my Section 1 -> child 1. But how can I show the two fragments on the same Activity if my tablet is in Landscape mode?

Normally I use a layout with 2 FrameLayout and add the fragments. How can I do this if I can't change the layout? Would I need to create a activity_material_navigation_drawer.xml for this?

@neokree
Copy link
Owner

neokree commented Jan 27, 2015

What do you mean with the "two fragments"?
Essentially, with tablets the setFragmentChild is setted into the right content.
The drawer will not change at all.

@tsuharesu
Copy link

I mean have 2 fragments on the same activity, without counting the NavDrawer. Like here http://developer.android.com/training/basics/fragments/fragment-ui.html

@neokree
Copy link
Owner

neokree commented Jan 28, 2015

Well, if you want to create your master/detail fragment flow, you can do it, but this library implements a navigation drawer. When you use the gmail app with a tablet the navigation drawer will not be overrided.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants