I need to implement expand and collapse notification in status bar for android 4.0 and above version. I have search on google for this but didn\'t getting any code solution for
There is a method for this function you can show a small icon when notification collapsed and show a large one when a notification expanded.
val bitmap = BitmapFactory.decodeResource(resources, R.drawable.notification)
var notification = NotificationCompat.Builder(context, CHANNEL_ID)
.setSmallIcon(R.drawable.new_post)
.setContentTitle(imageTitle)
.setContentText(imageDescription)
.setLargeIcon(bitmap)
.setStyle(NotificationCompat.BigPictureStyle()
.bigPicture(bitmap)
.bigLargeIcon(null))
.build()