Android Design and Development series second: Navigation Drawer

Source: Internet
Author: User
Tags home screen

Navigation Drawer

Creating a Navigation Drawer

The navigation drawer is a panel this transitions in from the left edge of the the screen and displays the app ' s main navigati On options.

Displaying the navigation drawer

The user can bring the navigation drawer onto the screen by swiping from the left edge of the "screen" or by touching the AP Plication icon on the action bar.

As the navigation drawer expands, it overlays the content but not the action bar. When the drawer was fully extended, the action bar adjusts its content by replacing the current action bar title with the A PP name and removing all actions, that is contextual to the view underneath the navigation drawer. The overflow menu with the standard action items for Settings and help remains visible.

The user can open the drawer panel by touching the navigation drawer indicator.

Because They is transient, navigation drawers make views less cluttered. You can also use them @ deeper levels in the navigation hierarchy, allowing users-to-switch to your app's most important Screens from anywhere in the app.

Open the drawer from anywhere in your app by swiping from the left edge of the. Dismissing the navigation drawer

When the navigation drawer are expanded, the user can dismiss it in one's four ways:

    • Touching the content outside the navigation drawer
    • Swiping to the left anywhere on the screens (including edge swipe from right)
    • Touching the app Icon/title in the action Bar
    • Pressing back
When to use the Navigation Drawer

The navigation drawer is not a general replacement for top-level navigation via spinners or tabs. The structure of your app should guide your choice of which pattern to use for top-level switching. For more information in top-level switching mechanisms, see the application Structure design pattern.

Here is some examples of where navigation drawers work best:

More than 3 top-level views

Navigation drawers is great for displaying a large number of Navigation targets concurrently. The use of the navigation drawer if you has more than than 3 unique top-level views. If not, use the fixed tabs for top-level organization to ease discovery and interaction.

Cross-navigation from lower levels

If your app requires cross-navigating between Lower-level screens, consider using the navigation drawer. Because it is accessible from anywhere in the app, the drawer enables efficient navigation from lower-level screens to Oth Er important places in your app.


The navigation drawer makes cross-navigation at lower levels possible. Deep navigation branches

If you had particularly deep branches, navigating to the top-level of your app can become repetitive and cumbersome with Up and back alone. Since navigation drawers was accessible from anywhere in the app, navigation up to the top level was faster and more Effici Ent.

The navigation drawer allows for quick jumps to the top-level of your apps, removing the need for repetitive back or up seq Uences. Navigation Hubs

The navigation drawer is a reflection of your app's structure and displays its major navigation hubs. Think of navigation hubs as those places in your app that a user would want to visit frequently or use as a Jumping-off poi NT to other parts of the app. At a minimum, the navigation hubs is the top-level, since they correspond to your app ' s major functional areas.

If your app ' s structure is deep, you can add screens from lower levels that your users would likely visit often and make th OSE navigation hubs as well.

The navigation drawer contains all of the Your app ' s navigation hubs. Include your top level screens as well as important lower-level screens.

To facilitate access to the navigation drawer on navigation hubs, all screens that correspond to a entry in your Navigati On drawer should show the navigation drawer indicator next to the application icon in the action Bar. Touching the app icon causes the navigation drawer to slide on from the left.

All and lower-level screens show the traditional up indicator next to the application icon. The drawer is still accessible with a edge-swipe, but isn't featured in the action Bar.

App icon with navigation drawer indicator. Content of the Navigation Drawer

Keep the content of the navigation drawer focused on app navigation. Expose the navigation hubs of your app as list items inside the navigation Drawer-one item per row.

Titles, icons, and counters

You can structure navigation targets by adding titles. The titles aren't interactive, but just organize navigation targets into functional topics. If you had many navigation targets, use titles to orient the user within the drawer.

Navigation targets can has optional leading icons as well as trailing counters. The counters to inform users on a changed state of data in the corresponding view.


Use the titles and icons to organize your drawer.
Collapsible navigation items are split. Use the left side for navigation and the right to collapse and expand items. Collapsible navigation Items

If you had many views with some subordinate to others, consider collapsing them into one expandable item to conserve SPAC E. The parent in the navigation drawer then turns into a split item. The left side allows navigation to the parent item's view, and the right side collapses or expands the list of child items .

At launch, the initial state of the collapsible items are up to you. As a rule, all top-level view entries of the navigation drawer should is visible. If you had many collapsible items, consider collapsing all items, and the user to see the top-level views in their en Tirety.

When the user opens the drawer from a lower-level screens, expand the associated branch of the top-level view to give a str Onger sense of place and highlight navigation opportunities close to the user's current location in the app.

Navigation Drawers and Action Bars

When the user expands the navigation drawer, the task focus switches to selecting a item from the drawer. Because the drawer does not overlay the action bar, and users may not be realize that the items in the action bar does not pertain To the navigation drawer.

To reduce confusion, adjust the content of the action Bar to the following, once the drawer is fully expanded:

    • APP icon
    • APP Name
    • The Remove actions from the action Bar is contextual to the underlying view (such as Create New, Refresh). Retain actions with global scope, such as "Search".
    • Overflow menu with expected navigation targets, such as Settings and help.

Clean up the action bar when the drawer is fully expanded. Remove actions that is not needed and display your app's name in the title area. Actions
Keep actions on the right side of the action bar and in the overflow

Don ' t place actions in the navigation drawer. Actions belong in the action bar, and the user expects to see them there. Keep in mind, that isn't all applications use the navigation drawer pattern. It is tempting to expose all your app's capabilities in a single place, but keep the bigger picture in mind. Place your actions where all apps display them.

This also applies to common navigation targets, such as access to help or the app ' s Settings. As per style guide convention Help and Settings is always located in the action overflow.


Keep Help and Settings in the overflow. Contextual Action Bars

Sometimes the user is in a state where a contextual action bar (CAB) appears instead of the app ' s action Bar. This typically happens if the user selects text or selects multiple items after a press-and-hold gesture. While the CAB was visible, you should still allow the user-to-open the navigation drawer using an edge swipe. However, replace the CAB with the standard Action bar and the navigation drawer is open. When the user dismisses the drawer, re-display the CAB.


Hide contextual Action Bars while the drawer is visible.

If the user navigates away from a view with selected content, deselect the content before before navigating to the new Vie W.

Interaction Details Introduce the user to the drawer on first use

Upon first launch of your app, introduce the user to the navigation drawer by automatically opening it. This ensures, the users know about the navigation drawer and prompts them to learn about the structure of your apps by expl Oring its content. Continue showing the drawer upon subsequent launches until the user actively expands the navigation drawer manually. Once you know this user understands how to open the drawer, launch the app with the navigation drawer closed.


At first use, show the navigation drawer automatically to help the user learn the functionality and structure of the Your app. Give the User A quick Peek

If the user touches the very left edge of the "screen" (within DP from the "left"), the drawer peek out as soon as the Finger makes contact with the display. This promotes accidental discovery and provides richer feedback.


The navigation drawer peeks out when the user touches the very left edge of the screen. Highlights

When your open the navigation drawer from a screens that's represented inside the drawer, highlight its entry in the drawer . Vice Versa, if you open the drawer from a screens that's not listed in the drawer, none of the items of the drawer should Be highlighted.

Impact of Drawer on Overall App Navigation

The navigation drawer is a alternative to other top-level navigation patterns. To do apps with navigation drawers work consistently with apps the use a tab or spinner pattern, remember the all Navi Gation requirements for system back and up apply.

Pay special attention to the following situations:

System back on the top level of the app

Touching System back at the app's top level never opens the navigation drawer. Instead, System back behaves according to the navigation rules for the top level, such as navigating to the previous app W Ithin the task or navigating to the Home screen.


System back does isn't show the drawer, but behaves according to the navigation rules for the top level. System navigation to lower hierarchy levels

If the user navigates to a lower hierarchy screens from the navigation drawer and the screen have a direct parent, then the Back stack was reset and back points to the target screen ' s parent. This "behavior is" the same as when a user navigates to an app from a notification.


Reset the back stack if your lower-level navigation target has direct parents. Style

The width of the navigation drawer depends on the content of your want to display, but should be between a minimum of DP a nd a maximum of. The height of the individual line items should is not fall below-DP. See the layout guideline below for recommendations on padding and spacing.


Layout guidelines for the navigation drawer.

Pick the drawer background to best match your app ' s theme. See the following examples for a holo light and a holo dark themed drawer.


Navigation drawers in holo light and holo dark themed apps. Navigation Drawer Checklist

Even if you already the support a similar navigation drawer, the update your drawer to the this pattern to make sure that:

    • The action Bar remains in place and adjusts its content.
    • Your Navigation drawer overlays the content.
    • Any view represented in the drawer have a navigation drawer indicator in IT action Bar that allows the drawer to be opened By touching the app icon.
    • You take advantage of the new visual drawer transition.
    • Any view isn't represented in the drawer maintains the traditional up indicator on its action bar.
    • You stay on sync with the general navigation patterns for up and back.

Android Design and Development series second: Navigation Drawer

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.