i want implement colorful, customized notification in android app.
i tried implement color, moment can set background color. want reach kind of result:
with image of app shown notification pic when expanded.
here code @ moment:
return builder.setcontenttitle("app title") .setcontenttext("some texts") .setsmallicon(r.mipmap.ic_launcher) .setcontentintent(pendingintent) .setongoing(true) .setautocancel(true) .setvisibility(notification.visibility_public) .setpriority(notification.priority_high) .setcategory(notification.category_alarm) .setonlyalertonce(false) .setcolor(getresources().getcolor(r.color.colorprimary));
how can implement icon notification colorful, hangouts example posted above?
mnotifybuilder = new notificationcompat.builder(this) .setcontenttitle(getresources().getstring(r.string.app_name)) .setcontenttext(messs) .setlargeicon(bitmap) .setsmallicon(r.mipmap.hangouts_launcher) .setstyle(new notificationcompat.bigtextstyle().bigtext(message)); mnotifybuilder.setcontentintent(pintent); // set vibrate, sound , light int defaults = 0; defaults = defaults | notification.default_lights; defaults = defaults | notification.default_vibrate; defaults = defaults | notification.default_sound; mnotifybuilder.setdefaults(defaults); // set content notification mnotifybuilder.setcontenttext(messs); mnotificationmanager.notify(m, mnotifybuilder.build());
Comments
Post a Comment