private NotificationCompat.Builder createPageBuilder(int titleResId, CharSequence text) { final BigTextStyle style = new NotificationCompat.BigTextStyle(); style.setBigContentTitle(getString(titleResId)); style.setSummaryText(text); return new NotificationCompat.Builder(mContext, CHANNEL_DEFAULT) .setStyle(style) .setContentTitle(getString(titleResId)) .setContentText(text) .setGroup(mGroup) .setGroupSummary(false) .setContentIntent(createDrugListIntent(mDate)) .setSmallIcon(R.drawable.ic_stat_normal); }
.bigText(contentString) .setBigContentTitle(title) .setSummaryText(titleString)) .setAutoCancel(true) .setColor(context.getResources().getColor(R.color.oc_primary));
.bigText(contentString) .setBigContentTitle(title) .setSummaryText(titleString)) .setAutoCancel(true) .setColor(context.getResources().getColor(R.color.oc_primary));
.bigText(message) .setBigContentTitle(getString(R.string.sending)) .setSummaryText(message)) .setContentTitle(getString(R.string.sending)) .setContentText(message)
.bigText("BigText") .setBigContentTitle("BigContentTitle") .setSummaryText("SummaryText"));
.bigText(text) .setBigContentTitle(title) .setSummaryText("--"))
"content\nbig text content\n") .setBigContentTitle("big text title") .setSummaryText("big text summary")); } else if (position == 2) { Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.photo480);
NotificationCompat.BigTextStyle notiStyle = new NotificationCompat.BigTextStyle(); notiStyle.setBigContentTitle(title); notiStyle.setSummaryText(text); notiStyle.bigText(bigText); mNotificationBuilder.setStyle(notiStyle);
bigtextstyle.setSummaryText("5"); bigtextstyle.setBigContentTitle("6"); bigtextstyle.bigText("7");
style.setBigContentTitle(String.format( getResources().getString(R.string.step_count), i + 1, stepCount)); style.setSummaryText(""); NotificationCompat.Builder builder = new NotificationCompat.Builder(this); builder.setStyle(style);
/** * Notify the user of a error. * * @param title Title of the notification. * @param text Text of the notification. * @param extra Extra information to show to user. */ @Override public void failedImage(String title, String text, String extra) { analytics.track("Frame Generation Error", new Properties().putValue("title", title).putValue("text", text).putValue("extra", extra)); Notification notification = new NotificationCompat.Builder(this) // .setTicker(title) .setContentTitle(title) .setContentText(text) .setStyle(new NotificationCompat.BigTextStyle() // .setBigContentTitle(title) // .bigText(text) // .setSummaryText(extra)) .setSmallIcon(R.drawable.ic_action_error) .setWhen(System.currentTimeMillis()) .setAutoCancel(true) .setContentIntent( PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), 0)) .build(); notificationManager.notify(DFG_NOTIFICATION_ID, notification); } }
/** * add big content text to notification * @param title the notification title when expanded * @param contentText notification content text when expanded * @param summaryText can be seen as a subtitle, not very useful * */ public SimpleNotificationBuilder setBigText(String title, String contentText, String summaryText) { NotificationCompat.BigTextStyle bigTextStyle = new NotificationCompat.BigTextStyle(); bigTextStyle.setBigContentTitle(title); bigTextStyle.bigText(contentText); if (!TextUtils.isEmpty(summaryText)) { bigTextStyle.setSummaryText(summaryText); } setStyle(bigTextStyle); return this; } /**