- mNotification = new Notification(DisplayUtils.getSeasonalIconId(), getString(R.string.uploader_upload_in_progress_ticker),
- System.currentTimeMillis());
- mNotification.flags |= Notification.FLAG_ONGOING_EVENT;
- mDefaultNotificationContentView = mNotification.contentView;
- mNotification.contentView = new RemoteViews(getApplicationContext().getPackageName(),
- R.layout.progressbar_layout);
- mNotification.contentView.setProgressBar(R.id.status_progress, 100, 0, false);
- mNotification.contentView.setTextViewText(R.id.status_text,
- String.format(getString(R.string.uploader_upload_in_progress_content), 0, upload.getFileName()));
- mNotification.contentView.setImageViewResource(R.id.status_icon, DisplayUtils.getSeasonalIconId());
-
+ mNotificationBuilder =
+ NotificationBuilderWithProgressBar.newNotificationBuilderWithProgressBar(this);
+ mNotificationBuilder
+ .setOngoing(true)
+ .setSmallIcon(R.drawable.notification_icon)
+ .setTicker(getString(R.string.uploader_upload_in_progress_ticker))
+ .setContentTitle(getString(R.string.uploader_upload_in_progress_ticker))
+ .setProgress(100, 0, false)
+ .setContentText(
+ String.format(getString(R.string.uploader_upload_in_progress_content), 0, upload.getFileName()));
+