6

I am creating a custom notification layout for my application.

NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID)
            .setSmallIcon(R.drawable.ic_notification_icon)
            .setPriority(NotificationCompat.PRIORITY_DEFAULT)
            .setCustomContentView(notificationLayoutCollapsed)
            .setOngoing(playing)
            .setCustomBigContentView(notificationLayoutExpanded)
            .setStyle(new NotificationCompat.DecoratedCustomViewStyle())
            .setContentIntent(pendingIntent);



My notification layout does not have internal padding or margins yet there it shows margins for the notification (Thick white border around blue notification).

Please suggest a solution to this issue.

----ANSWER-----

Culprit is this following line

.setStyle(new NotificationCompat.DecoratedCustomViewStyle())

DecoratedCustomViewStyle gives the notification a border

Shashank Degloorkar
  • 3,151
  • 4
  • 32
  • 50

0 Answers0