Add Android Auto notification support
Signed-off-by: Alex Baker <alex@beeper.com>
This commit is contained in:
parent
cde6e8cc1b
commit
09a25cce4e
|
@ -0,0 +1 @@
|
|||
Android Auto notification support
|
|
@ -83,6 +83,10 @@
|
|||
android:name="android.max_aspect"
|
||||
android:value="9.9" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.android.gms.car.application"
|
||||
android:resource="@xml/automotive_app_desc" />
|
||||
|
||||
<activity
|
||||
android:name=".features.MainActivity"
|
||||
android:theme="@style/Theme.Vector.Launcher" />
|
||||
|
|
|
@ -597,10 +597,12 @@ class NotificationUtils @Inject constructor(private val context: Context,
|
|||
val markRoomReadPendingIntent = PendingIntent.getBroadcast(context, System.currentTimeMillis().toInt(), markRoomReadIntent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
|
||||
addAction(NotificationCompat.Action(
|
||||
R.drawable.ic_material_done_all_white,
|
||||
stringProvider.getString(R.string.action_mark_room_read),
|
||||
markRoomReadPendingIntent))
|
||||
NotificationCompat.Action.Builder(R.drawable.ic_material_done_all_white,
|
||||
stringProvider.getString(R.string.action_mark_room_read), markRoomReadPendingIntent)
|
||||
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_MARK_AS_READ)
|
||||
.setShowsUserInterface(false)
|
||||
.build()
|
||||
.let { addAction(it) }
|
||||
|
||||
// Quick reply
|
||||
if (!roomInfo.hasSmartReplyError) {
|
||||
|
@ -611,6 +613,8 @@ class NotificationUtils @Inject constructor(private val context: Context,
|
|||
NotificationCompat.Action.Builder(R.drawable.vector_notification_quick_reply,
|
||||
stringProvider.getString(R.string.action_quick_reply), replyPendingIntent)
|
||||
.addRemoteInput(remoteInput)
|
||||
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_REPLY)
|
||||
.setShowsUserInterface(false)
|
||||
.build()
|
||||
.let { addAction(it) }
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<automotiveApp>
|
||||
<uses name="notification" />
|
||||
</automotiveApp>
|
Loading…
Reference in New Issue