Master/detail flow or navigation drawer ? which is better for display detail data about list items? - android

I have a list of persons that when user click on one item the app show its detail ! i used dual pane Master/detail design pattern for tablet size and for small size it just replace list with detail fragment.
The problem is that my manager think its better to change this design with navigation drawer ! what is the best choice for this case ? navigation drawer or master/detail design ?
which is better for user experience ?

The Navigation Drawer is:
a panel that transitions in from the left edge of the screen and displays the app’s main navigation options.
Per the App Structure guide:
A navigation drawer is a slide-out menu that allows users to switch between views of your app. It can hold a large number of items and is accessible from anywhere in your app. Navigation drawers show your app's top-level views, but can also provide navigation to lower-level screens. This makes them particularly suitable for complex apps.
And the Material Design structure guidelines state:
The content in the left nav is ideally navigation- or identity-based.
The Navigation Drawer is not listed as a mechanism for multi-pane layouts, while a master/detail multi-pane layout is specifically mentioned.
In short: Navigation Drawer is for navigation only and not for displaying a master list with corresponding detail.
In fact, one of the framework engineers wrote a Google+ post back in 2013 specifically about how they tried to use DrawerLayout (the class name for the navigation drawer) for displaying master/detail style content and instead built a separate component, SlidingPaneLayout specifically to address this issue of displaying master/detail on smaller screens without using the Navigation Drawer affordances or pattern as they just did not fit. Note that this has fallen slightly out of favor in Material design, with a re-emphasis on a traditional master/detail pattern with meaningful transition animations.

You can create 2 demo apps to see the difference on a phone.
Master Detail flow:
The master page (menu, or list page) will always be displayed to the user first and the master page covers the whole screen. If the user does not tap, he/she will not notice there is a detailed page.
Navigation drawer:
The detailed page will be displayed to the user first, with a navigation menu (3 stripes menu) on the top left corner.
If the user taps the navigation menu, he/she will see a sliding out page, which covers only half of the screen. For the most of the time, the menu screen will be hidden.
So they are actually very different from the design aspect. Of course, they have similarities during implementation.

Related

Android Navigation with nested bottom navigation

I'm new to Android Navigation Component and want to understand how can I use it in my relatively simple scenario where I want to have a single activity approach. I obviously want the system to handle the back stack, also for bottom navigation.
What I need is 2 very simple cases:
1. Mixed destinations
Some of the destinations in my navigation graph have bottom navigation, and some not. Imagine that I have a login flow without a bottom navigation and then move to the "real app" where I have bottom navigation. Google says put bottom navigation, drawer, action bar outside of navigation graph, which means they are shown for all destinations.
Is this supported by Navigation Component? Without dirty hacks of hiding/showing bottom nav.
2. Full screen popups
Another question - is multiple navhosts supported? Imagine I have a UI with bottom navigation and action bar, which are outside of the nav host area. But then I need to show a full screen popup, like a dialog or a resource selection screen, which will also go over the bottom nav and action bar.
Can I do this as a destination in navigation graph?
For both questions any conceptually supported solution is good for me, including switching graphs/hosts during navigation.
As per the Listen for navigation events documentation:
As an example, you might have common UI elements that you intend to show in some areas of your app while hiding them in others. Using your own OnDestinationChangedListener, you can selectively show or hide these UI elements based on the target destination
So yes, you can selectively show or hide elements of your activity's UI when you move to certain destinations, such as your login screen.
As per the Create a destination from a DialogFragment documentation:
If you have an existing DialogFragment, you can use the <dialog> element to add the dialog to your navigation graph
This also supports other types of DialogFragment such as a BottomSheetDialogFragment.

Show Navigation drawer in every activity - android studio

I have a problem...I am developing an app in android studio.In the meantime,there is already a navigation drawer in it.But the problem is, it only appears in the home screen.When it goes to another screen, the navigation drawer is not shown. I am new to android studio but i know some of Java languages.Can anyone help me with providing anything that would help me make the navigation drawer show in all of slides and pages in my app.
from docs
Navigation Drawer
The navigation drawer is a panel that displays the app’s main
navigation options on the left edge of the screen. It is hidden most
of the time, but is revealed when the user swipes a finger from the
left edge of the screen or, while at the top level of the app, the
user touches the app icon in the action bar.
for achieve what you asked you have to use Fragments
Fragment represents a behavior or a portion of user interface in an
Activity. You can combine multiple fragments in a single activity to
build a multi-pane UI and reuse a fragment in multiple activities. You
can think of a fragment as a modular section of an activity, which has
its own lifecycle, receives its own input events, and which you can
add or remove while the activity is running (sort of like a "sub
activity" that you can reuse in different activities).
see this examples for more details
1. Navigation Drawer - android hive
2. Navigation Drawer exp 2
3. Navigation Drawer exp 3
Refer this answer also
Answer
You have to add fragments in that activity where the navigation drawer exist. Whenver the user will click on the option in the navigation drawer the view should be changed by replacing with the required fragment.So by using the fragments user will stay on the same activity but just the views will be changed in that activity. you can refer to the fragments documentation provided by android developers. https://developer.android.com/guide/components/fragments.html

Android navigation drawer with fragments

I have an activity that extends fragmentActivity that has a navigation Drawer, and three different fragments.
Is there a way to make a navigation Drawer that has different buttons inside each of my fragments?
For example when you enter fragment 1 you will see certain buttons in the navigation Drawer, and when you go to fragment 2 you will see different buttons in the navigation Drawer.
You should just define which options are to be displayed in the NavigationDrawer depending on which current Fragment you're on, using a switch statement or if statement.
Check out this link:
How to change fragments using Android navigation drawer
Also, from this link https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html
As per the Android Design guide, any drawers positioned to the
left/start should always contain content for navigating around the
application, whereas any drawers positioned to the right/end should
always contain actions to take on the current content. This preserves
the same navigation left, actions right structure present in the
Action Bar and elsewhere.
So this type of thing seems like it was planned for when the NavigationDrawer was designed.

Android navigation drawer - two levels

I am looking to replicate the iOS app my company makes and on tablet in landscape they have a second nav drawer slide out from the first for the second level of categories.
e.g. in the first level they have clothes, shoes, accessories, then if you click clothes a second one appears scrolling to the right from the far right of the first nav bar, that then shows things like shirts, t-shirt, jeans, jumpers etc.
Is this possible in android? And if so, is it the accepted way of doing things?
Thanks
on tablet in landscape they have a second nav drawer slide out from the first for the second level of categories.
That's not a nav drawer, then, at least as defined by Google.
Is this possible in android?
Sure, just not using DrawerLayout. Execute a FragmentTransaction to slide in the second list adjacent to the first list, neither of which are in a DrawerLayout.
And if so, is it the accepted way of doing things?
For a two-tier structure, I suspect that you will see other patterns used:
ExpandableListView
tabs for the first tier, and simpler master-detail for the second tier
action bar list navigation for the first tier, and simpler master-detail for the second tier
etc.
I can't even rule out DrawerLayout as being the implementation of the first tier (with traditional master-detail for the second tier), though the stuff in that list does not strike me as fitting the usage pattern for a navigation drawer.
Sure, It is possbile. But it is not a practise using in android.
If you want to implement this design, the best way is to use two fragments instead of navigation drawer and use FragmentTrasation to provide the animations.

Android Navigation Drawer Design

I have an existing application that has about 25 activities that are navigated to from a "dashboard". I would like to switch and start using the Navigation drawer and fragments. I have gone thru the Nav Drawer design pages online and the example app. My question is what is the best way to convert (structure) my app to fit the Nav Drawer pattern. If I switch my activities to be fragments and use a main activity to replace each fragment as navigation happens, but not sure if that is good b/c for a tablet layout, I might want multiple fragments on my view and not sure if this will limit me. If I go with the other direction I was thinking, keep all my activities and just switch the necessary ones to fragments for tablets but I would need each activity to create the navigation drawer (I think ?) which in my case the drawer is dynamic based on server data. Any suggestions would be great.
Thanks
Brandon
Navigation drawer has to be created for each activity, although you could inherit Activity and create a parent class that handles navigation drawer specific code if code duplication is a concern.
Using a drawer does not limit you to use one fragment per screen, just listen to onClick in drawer and initiate as many fragment transactions as you need.
When it comes to structuring your app, there is no universal advice, I would recommend you to watch Google I/O 2013 talk - Structure in Android App Design. Navigation Drawer is kind of the main theme of the talk.

Categories

Resources