page.title=Swipe Views page.tags="viewpager","navigation" @jd:body

Efficient navigation is one of the cornerstones of a well-designed app. While apps are generally built in a hierarchical fashion, there are instances where horizontal navigation can flatten vertical hierarchies and make access to related data items faster and more enjoyable. Swipe views allow the user to efficiently move from item to item using a simple gesture and thereby make browsing and consuming data a more fluent experience.

Swiping Between Detail Views

An app's data is often organized in a master/detail relationship: The user can view a list of related data items, such as images, chats, or emails, and then pick one of the items to see the detail contents in a separate screen.

Master (left) and detail (right) views.

On a phone, since the master and detail are on separate screens, this typically requires the user to jump back and forth between the list and the detail view, aka "pogo-sticking".

In cases where users will want to view multiple detail items in succession, avoid pogo-sticking by using the swipe gesture to navigate to the next/previous detail view.

Navigating between consecutive Email messages using the swipe gesture. If a view contains content that exceeds the width of the screen such as a wide Email message, make sure the user's initial swipes will scroll horizontally within the view. Once the end of the content is reached, an additional swipe should navigate to the next view. In addition, support the use of edge swipes to immediately navigate between views when content scrolls horizontally.
Scrolling within a wide Email message using the swipe gesture before navigating to the next message.

Swiping Between Tabs

People app with swipe gesture navigation between top-level screens.
 

If your app uses action bar tabs, use swipe to navigate between the different views.

 

Checklist

Developer Guide

For information about how to create swipe views, read Implementing Lateral Navigation.