Daniyal Javaid
Daniyal Javaid

Reputation: 1636

Custom Push Notification - Full width background color

I am implementing custom push notifications. I have a custom layout, modified using RemoteViews. I have set color using

        contentView.setInt(R.id.parentLayout, "setBackgroundColor", Color.parseColor("#4979C5"))

        notifBuilder.setColor(Color.parseColor("#4979C5"))
       .setColorized(true)

But it doesn't set color completely on background. I want it to have like this Android system notification

enter image description here

but I am getting this

enter image description here

Here is the styling that I have used:

notifBuilder.setColorized(true)
                .setColor(Color.parseColor("#4979C5"))
                .setStyle(NotificationCompat.DecoratedCustomViewStyle())
                .setContent(closedView)
                .setCustomBigContentView(contentView)
                .setSmallIcon(R.drawable.icon_tick)

I have tried using other styles and also removed the style but I get this result

enter image description here

Which seems to be fine as it does have background color set on complete notification area but now there is no details like app name, notification time, app icon and expand icon. Even action buttons are gone.

Upvotes: 2

Views: 1129

Answers (0)

Related Questions