Home | History | Annotate | Download | only in implementing-navigation

Lines Matching full:drawer

1 page.title=Creating a Navigation Drawer
13 <li><a href="#DrawerLayout">Create a Drawer Layout</a></li>
14 <li><a href="#Init">Initialize the Drawer List</a></li>
30 class="button">Download the nav drawer icons</a>
39 <p>The navigation drawer is a panel that displays the app?s main navigation options
44 <p>This lesson describes how to implement a navigation drawer using the
49 <p><strong>Navigation Drawer Design</strong></p>
50 <p>Before you decide to use a navigation drawer in your app, you should understand the use
52 <a href="{@docRoot}design/patterns/navigation-drawer.html">Navigation Drawer</a> design guide.</p>
56 <h2 id="DrawerLayout">Create a Drawer Layout</h2>
58 <p>To add a navigation drawer, declare your user interface with a
61 the main content for the screen (your primary layout when the drawer is hidden) and another view
62 that contains the contents of the navigation drawer.</p>
67 runtime), and a {@link android.widget.ListView} for the navigation drawer.</p>
80 &lt;!-- The navigation drawer -->
97 and the drawer must be on top of the content.</li>
100 navigation drawer is hidden.</li>
101 <li>The drawer view (the {@link android.widget.ListView}) <strong>must specify its horizontal
104 instead of {@code "left"} (so the drawer appears on the right when the layout is RTL).</p>
106 <li>The drawer view specifies its width in {@code dp} units and the height matches the parent
107 view. The drawer width should be no more than 320dp so the user can always
113 <h2 id="Init">Initialize the Drawer List</h2>
116 the navigation drawer's list of items. How you do so depends on the content of your app, but
117 a navigation drawer often consists of a {@link android.widget.ListView}, so the list
152 setOnItemClickListener()} to receive click events in the navigation drawer's list.
160 <p>When the user selects an item in the drawer's list, the system calls {@link
195 // Highlight the selected item, update the title, and close the drawer
214 <p>To listen for drawer open and close events, call {@link
218 for drawer events such as {@link
229 interaction behavior between the action bar icon and the navigation drawer (discussed further in
232 <p>As discussed in the <a href="{@docRoot}design/patterns/navigation-drawer.html">Navigation
233 Drawer</a> design guide, you should modify the contents of the action bar
234 when the drawer is visible, such as to change the title and remove action items that are
258 /** Called when a drawer has settled in a completely closed state. */
264 /** Called when a drawer has settled in a completely open state. */
271 // Set the drawer toggle as the DrawerListener
278 // If the nav drawer is open, hide action items related to the content view
294 <p>Users can open and close the navigation drawer with a swipe gesture from or towards the left
298 the navigation drawer with a special icon. You can implement all this behavior by using the
304 <li>The {@link android.app.Activity} hosting the drawer.
306 <li>A drawable resource to use as the drawer indicator.
309 <li>A String resource to describe the "open drawer" action (for accessibility).
310 <li>A String resource to describe the "close drawer" action (for accessibility).
314 {@link android.support.v4.app.ActionBarDrawerToggle} as your drawer listener, you need to call
331 R.drawable.ic_drawer, /* nav drawer icon to replace 'Up' caret */
332 R.string.drawer_open, /* "open drawer" description */
333 R.string.drawer_close /* "close drawer" description */
336 /** Called when a drawer has settled in a completely closed state. */
341 /** Called when a drawer has settled in a completely open state. */
347 // Set the drawer toggle as the DrawerListener
383 <p>For a complete example of a navigation drawer, download the sample available at the