use of android.app.Notification in project k-9 by k9mail.
the class NewMailNotifications method createStackedNotification.
private void createStackedNotification(Account account, NotificationHolder holder) {
if (isPrivacyModeEnabled()) {
return;
}
Notification notification = wearNotifications.buildStackedNotification(account, holder);
int notificationId = holder.notificationId;
getNotificationManager().notify(notificationId, notification);
}
use of android.app.Notification in project android-oss by kickstarter.
the class PushNotifications method displayNotificationFromProjectActivity.
private void displayNotificationFromProjectActivity(@NonNull final PushNotificationEnvelope envelope) {
final GCM gcm = envelope.gcm();
final Activity activity = envelope.activity();
if (activity == null) {
return;
}
final Long projectId = activity.projectId();
if (projectId == null) {
return;
}
final String projectPhoto = activity.projectPhoto();
final String projectParam = ObjectUtils.toString(projectId);
NotificationCompat.Builder notificationBuilder = notificationBuilder(gcm.title(), gcm.alert()).setContentIntent(projectContentIntent(envelope, projectParam));
if (projectPhoto != null) {
notificationBuilder = notificationBuilder.setLargeIcon(fetchBitmap(projectPhoto, false));
}
final Notification notification = notificationBuilder.build();
notificationManager().notify(envelope.signature(), notification);
}
use of android.app.Notification in project android-oss by kickstarter.
the class PushNotifications method displayNotificationFromProjectReminder.
private void displayNotificationFromProjectReminder(@NonNull final PushNotificationEnvelope envelope) {
final GCM gcm = envelope.gcm();
final PushNotificationEnvelope.Project project = envelope.project();
if (project == null) {
return;
}
final Notification notification = notificationBuilder(gcm.title(), gcm.alert()).setContentIntent(projectContentIntent(envelope, ObjectUtils.toString(project.id()))).setLargeIcon(fetchBitmap(project.photo(), false)).build();
notificationManager().notify(envelope.signature(), notification);
}
use of android.app.Notification in project Signal-Android by WhisperSystems.
the class UpdateApkReadyListener method displayInstallNotification.
private void displayInstallNotification(Context context, Uri uri) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setDataAndType(uri, "application/vnd.android.package-archive");
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
Notification notification = new NotificationCompat.Builder(context).setOngoing(true).setContentTitle(context.getString(R.string.UpdateApkReadyListener_Signal_update)).setContentText(context.getString(R.string.UpdateApkReadyListener_a_new_version_of_signal_is_available_tap_to_update)).setSmallIcon(R.drawable.icon_notification).setColor(context.getResources().getColor(R.color.textsecure_primary)).setPriority(NotificationCompat.PRIORITY_HIGH).setCategory(NotificationCompat.CATEGORY_REMINDER).setContentIntent(pendingIntent).build();
ServiceUtil.getNotificationManager(context).notify(666, notification);
}
use of android.app.Notification in project Signal-Android by WhisperSystems.
the class RegistrationNotifier method onReceive.
@Override
public void onReceive(Context context, Intent intent) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
builder.setSmallIcon(R.drawable.icon_notification);
builder.setContentTitle(intent.getStringExtra(RegistrationService.NOTIFICATION_TITLE));
builder.setContentText(intent.getStringExtra(RegistrationService.NOTIFICATION_TEXT));
builder.setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, ConversationListActivity.class), 0));
builder.setWhen(System.currentTimeMillis());
builder.setDefaults(Notification.DEFAULT_VIBRATE);
builder.setAutoCancel(true);
Notification notification = builder.build();
((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)).notify(31337, notification);
}
Aggregations