Slide 23
Slide 23 text
Build apps for Cars
Messaging with AndroidX Core
DroidKaigi.collect { #5@Nagoya }
val sender = Person.Builder()
.setName("John Doe")
.build()
val style = NotificationCompat.MessagingStyle(sender)
.addMessage("hello!", System.currentTimeMillis(), sender)
val markAsReadIntent = PendingIntent.getBroadcast(/* */)
val markAsReadAction = NotificationCompat.Action.Builder(R.drawable.ic_mark_as_read, "Mark as read", markAsReadIntent)
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_MARK_AS_READ)
.build()
val replyPendingIntent = PendingIntent.getBroadcast(/* */)
val replyInput = RemoteInput.Builder("input")
.build()
val replyAction = NotificationCompat.Action.Builder(R.drawable.ic_reply, "Reply", replyPendingIntent)
.addRemoteInput(replyInput)
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_REPLY)
.build()
val notification = NotificationCompat.Builder(context, "notification_channel")
.setContentTitle("title")
.setContentText("message")
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.addAction(markAsReadAction)
.addAction(replyAction)
.setStyle(style)
.build()