When I use BigTextStyle and BigPictureStyle together, only setContentText and BigPictureStyle are shown in the notification drawar. I mean if the text is long, it won't show the full text (BigTextStyle doesn't seem to work at all) It shows the same on my phone (Android 11), Does anyone know how I can solve this problem?
private fun sendNotification() {
val intent = Intent(this, MainActivity::class.java)
val pendingIntent: PendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE)
val bitmap = BitmapFactory.decodeResource(applicationContext.resources, R.drawable.wallet)
val bitmapLargeImage = BitmapFactory.decodeResource(applicationContext.resources, R.drawable.sell)
val builder = NotificationCompat.Builder(this, CHANNEL_ID)
.setSmallIcon(R.drawable.ic_baseline_attach_money_24)
.setContentTitle("Purchase")
.setContentText("This is the text I want to show to my users in the notification bar, but it is not fully shown.")
.setContentIntent(pendingIntent)
.setStyle(NotificationCompat.BigTextStyle().bigText("This is the text I want to show to my users in the notification bar, but it is not fully shown."))
.setStyle(NotificationCompat.BigPictureStyle().bigPicture(bitmapLargeImage))
.setLargeIcon(bitmap)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
with(NotificationManagerCompat.from(this)) {
notify(notificationID, builder.build())
}
}