Creating a Navigation Drawer in Android

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 …

Creating Swipe Views with Tabs in Android

Swipe views provide lateral navigation between sibling screens such as tabs with a horizontal finger gesture (a pattern sometimes known as horizontal paging). This lesson teaches you how to create a tab layout with swipe views for switching between tabs, or how to show a title strip instead of tabs. Swipe View Design Before implementing …

Providing Proper Back Navigation in Android

Back navigation is how users move backward through the history of screens they previously visited. All Android devices provide a Back button for this type of navigation, soyour app should not add a Back button to the UI. In almost all situations, the system maintains a back stack of activities while the user navigates your …

Providing Up Navigation in Android

All screens in your app that are not the main entrance to your app (the “home” screen) should offer the user a way to navigate to the logical parent screen in the app’s hierarchy by pressing the Up button in the action bar. This lesson shows you how to properly implement this behavior. Up Navigation …

Preserving Navigation when Starting an Activity in Android

Part of designing a notification is preserving the user’s expected navigation experience. For a detailed discussion of this topic, see the Notifications API guide. There are two general situations: Regular activity You’re starting an Activity that’s part of the application’s normal workflow. Special activity The user only sees this Activity if it’s started from a …

Building a Notification in Android

This lesson explains how to create and issue a notification. The examples in this class are based on the NotificationCompat.Builder class.NotificationCompat.Builder is in the Support Library. You should use NotificationCompat and its subclasses, particularly NotificationCompat.Builder, to provide the best notification support for a wide range of platforms. Create a Notification Builder When creating a notification, …

Implementing Descendant Navigation in Android

Descendant navigation is navigation down the application’s information hierarchy. This is described in Designing Effective Navigation and also covered in Android Design: Application Structure. Descendant navigation is usually implemented using Intent objects and startActivity(), or by adding fragments to an activity using FragmentTransaction objects. This lesson covers other interesting cases that arise when implementing descendant …

Adding Swipe-to-Refresh To Your App in Android

The swipe-to-refresh user interface pattern is implemented entirely within theSwipeRefreshLayout widget, which detects the vertical swipe, displays a distinctive progress bar, and triggers callback methods in your app. You enable this behavior by adding the widget to your layout file as the parent of a ListView or GridView, and implementing the refresh behavior that gets …