-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Common Navigation Paradigms
Navigation between views is an important part of any application. There are several ways to setup navigation in an Android application:
- Swipe Views - Allow paging between views using a swipe gesture
- Navigation Drawer - Displays a vertical menu that slides in to allow navigation between views
- ActionBar - Using the ActionBar and/or ActionBar tabs to switch between different views
- Screen Map - Providing a series of buttons on screen that can be pressed to visit different views
These four represent the most common navigation paradigms in Android applications. The specifics for how to implement these can be found in the various links above.
Check out the ViewPager with FragmentPagerAdapter cliffnotes for more details of how to add swipe-able views as a form of navigation. We can use a tab indicator to display tabs on top of a swiping view.
To create a basic navigation drawer that toggles between displaying different fragments, check out the Fragment Navigation Drawer cliffnotes. For more details about creating a custom drawer check out the Creating a Navigation Drawer docs.
Check out the ActionBar Tabs cliffnotes for more details of how to add ActionBar tabs to your Activity. Note that ActionBar Tabs is deprecated since Android API 21.
Created by CodePath with much help from the community. Contributed content licensed under cc-wiki with attribution required. You are free to remix and reuse, as long as you attribute and use a similar license.
Finding these guides helpful?
We need help from the broader community to improve these guides, add new topics and keep the topics up-to-date. See our contribution guidelines here and our topic issues list for great ways to help out.
Check these same guides through our standalone viewer for a better browsing experience and an improved search. Follow us on twitter @codepath for access to more useful Android development resources.