Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Notification Big Picture Style and Big Text Style

I've build a push notification using Big Picture Style as show here. Is it possible to mix Big picture Style and Big Text Style as shown in the attached photo? How do I do it?

enter image description here

like image 213
Mitsus Avatar asked Aug 18 '14 10:08

Mitsus


People also ask

How do I get big picture notifications on Android?

BigPictureStyle is used for showing a big picture in the notification item. It has two states — collapsed state and expanded state. In collapsed state, it shows exactly the same as an ordinary notification. When it is expanded, it shows a new set of content title, summary text, large icon and picture.


2 Answers

You should be able to do it this way:

Notification notif = new Notification.Builder(context)
     .setContentTitle("Title")
     .setContentText("content")
     .setSmallIcon(R.drawable.ic_small)
     .setLargeIcon(bitmap)
     .setStyle(new Notification.BigPictureStyle()
         .bigPicture(bigBitmap)
         .setBigContentTitle("big title"))
     .build();

Source

like image 50
Simon Marquis Avatar answered Sep 28 '22 04:09

Simon Marquis


View More... text in your norification is subtext. So while using bigpicturestyle notification you need to set

bigPicStyle.setSummaryText(mContent);

or

mBuilder.setSubText(mSubText);

Setting both at same time doesn't work.

like image 26
dayanand Avatar answered Sep 28 '22 06:09

dayanand