// makes a factory with the built-in clean theme // themes are customizeable NotificationFactory factory = new NotificationFactory(ThemePackagePresets.cleanLight()); // factories build notifications using a theme, while managers handle how // how they appear on the screen // this manager just simple pops up the notification in the specified location // other managers do sliding, queues, etc. NotificationManager plain = new SimpleManager(Location.NORTHEAST); // creates a text notification; you can also have progress bar Notifications, // icon Notifications, Notifications that ask for user feedback, etc. TextNotification notification = factory.buildTextNotification("This is a title", "This is a subtitle"); notification.setCloseOnClick(true); // the notification will disappear after 2 seconds, or after you click it plain.addNotification(notification, Time.seconds(2));
addNotification(newNotice);