I'm trying to create a Notification on Android 7 with a custom layout but I want to use the DecoratedCustomView Style from the v7-Support Library: https://developer.android.com/reference/android/support/v7/app/NotificationCompat.DecoratedCustomViewStyle.html
The reason why I want to use this style is that I want to use the notification header provided by android, as the documentation states:
Instead of providing a notification that is completely custom, a developer can set this style and still obtain system decorations like the notification header with the expand affordance and actions.
So I tried it with RemoteViews only containing a LinearLayout with a single TextView.
final NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context)
.setWhen(new Date().getTimeInMillis())
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle("title")
.setContentText("text")
.setStyle(new android.support.v7.app.NotificationCompat.DecoratedCustomViewStyle())
.setContent(remoteViews);
The result is a Notification just containing my RemoteViews and no header unfortunately. I just found one example using this on medium: https://medium.com/@britt.barak/notifications-part-3-going-custom-31c31609f314
But I'm not able to use the header provided by Android. Any help would be appreciated :)