Category «Android Basics»

Using Big View Styles in Android

Notifications in the notification drawer appear in two main visual styles, normal view and big view. The big view of a notification only appears when the notification is expanded. This happens when the notification is at the top of the drawer, or the user clicks the notification. Big views were introduced in Android 4.1, and …

Updating Notifications in Android

When you need to issue a notification multiple times for the same type of event, you should avoid making a completely new notification. Instead, you should consider updating a previous notification, either by changing some of its values or by adding to it, or both. The following section describes how to update notifications and also …

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 …

Remaining Backward Compatible in Android

The SearchView and action bar are only available on Android 3.0 and later. To support older platforms, you can fall back to the search dialog. The search dialog is a system provided UI that overlays on top of your application when invoked. Set Minimum and Target API levels To setup the search dialog, first declare …

Responding to a Refresh Request in Android

This lesson shows you how to update your app when the user requests a manual refresh, whether the user triggers the refresh with a swipe gesture or by using the action bar refresh action. Respond to the Refresh Gesture When the user makes a swipe gesture, the system displays the progress indicator and calls your …

Setting Up the App Bar in Android

In its most basic form, the action bar displays the title for the activity on one side and anoverflow menu on the other. Even in this simple form, the app bar provides useful information to the users, and helps to give Android apps a consistent look and feel. Figure 1. An app bar with the …