Notifications

You can post a banner notification, which appears subtly in the notification bar below the main window and is typically followed by a dashboard panel to allow for deferred action on the notification. For more urgent actions, you can use a pop-up notification, which slides up out of the notification bar and reduces the window size of the Card view or foreground card. All notifications and dashboards are nonmodal, meaning users can continue to interact with whatever is in the foreground view until they are ready to address the notifications or interact with the dashboard.

Banner Notifications

A banner includes an icon and a short message accompanied by an audible alert signaling the user to the presence of the banner. After a few seconds, the banner is removed. The banner is usually accompanied by a dashboard summary, which serves as a reminder of the notification and can provide additional details about the notification.

Back to the News: Banner notifications

Each time new stories are added during an update cycle, News will post a banner notification with the name of the feed and number of new stories, as shown in Figure 10-1. We’ll add the code to actually post the notification in the feedRequestSuccess() method, but we’ll add an initial condition that will inhibit notifications when they are turned off in the application’s preferences scene. The code for the preferences scene change isn’t shown, but you can see it in Appendix D:

// If successful processFeed returns ...

Get Palm webOS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.