use of android.preview.support.v4.app.NotificationManagerCompat in project WordPress-Android by wordpress-mobile.
the class NativeNotificationsUtils method showMessageToUserWithBuilder.
public static void showMessageToUserWithBuilder(NotificationCompat.Builder builder, String message, boolean intermediateMessage, int pushId, Context context) {
if (!intermediateMessage) {
builder.setStyle(new NotificationCompat.BigTextStyle().bigText(message));
}
builder.setProgress(0, 0, intermediateMessage);
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
notificationManager.notify(pushId, builder.build());
}
use of android.preview.support.v4.app.NotificationManagerCompat in project WordPress-Android by wordpress-mobile.
the class NotificationDismissBroadcastReceiver method onReceive.
@Override
public void onReceive(Context context, Intent intent) {
int notificationId = intent.getIntExtra("notificationId", 0);
if (notificationId == GCMMessageService.GROUP_NOTIFICATION_ID) {
GCMMessageService.clearNotifications();
} else {
GCMMessageService.removeNotification(notificationId);
// Dismiss the grouped notification if a user dismisses all notifications from a wear device
if (!GCMMessageService.hasNotifications()) {
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
notificationManager.cancel(GCMMessageService.GROUP_NOTIFICATION_ID);
}
}
}
use of android.preview.support.v4.app.NotificationManagerCompat in project wh-app-android by WhiteHouse.
the class NotificationPublisher method onReceive.
@Override
public void onReceive(Context context, Intent intent) {
final NotificationManagerCompat nm = NotificationManagerCompat.from(context);
final Notification n = intent.getParcelableExtra(EXTRA_NOTIFICATION);
final int id = intent.getIntExtra(EXTRA_NOTIFICATION_ID, 0);
nm.notify(id, n);
}
use of android.preview.support.v4.app.NotificationManagerCompat in project wh-app-android by WhiteHouse.
the class LiveService method postLiveItem.
private void postLiveItem(final FeedItem item) {
final Notification notification = buildLiveNotification(item);
final NotificationManagerCompat nm = NotificationManagerCompat.from(this);
nm.notify(0, notification);
}
Aggregations