I wanted to make a custom notification view with content being updated in interval of time. The custom view might contain the action button. In android documentation, we can create custom view using XML layout docs: https://developer.android.com/training/notify-user/custom-notification
// Get the layouts to use in the custom notification
val notificationLayout = RemoteViews(packageName, R.layout.notification_small)
val notificationLayoutExpanded = RemoteViews(packageName, R.layout.notification_large)
// Apply the layouts to the notification
val customNotification = NotificationCompat.Builder(context, CHANNEL_ID)
.setSmallIcon(R.drawable.notification_icon)
.setStyle(NotificationCompat.DecoratedCustomViewStyle())
.setCustomContentView(notificationLayout)
.setCustomBigContentView(notificationLayoutExpanded)
.build()
So can we make our own custom notification view using jetpack compose ?