mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 03:28:52 +01:00
Added "speak" option for new message notification buttons
This commit is contained in:
@@ -59,6 +59,7 @@ class Preferences @Inject constructor(
|
||||
const val NOTIFICATION_ACTION_CALL = 4
|
||||
const val NOTIFICATION_ACTION_READ = 5
|
||||
const val NOTIFICATION_ACTION_REPLY = 6
|
||||
const val NOTIFICATION_ACTION_SPEAK = 7
|
||||
|
||||
const val SEND_DELAY_NONE = 0
|
||||
const val SEND_DELAY_SHORT = 1
|
||||
|
||||
@@ -51,6 +51,7 @@ import dev.octoshrimpy.quik.receiver.MarkArchivedReceiver
|
||||
import dev.octoshrimpy.quik.receiver.MarkReadReceiver
|
||||
import dev.octoshrimpy.quik.receiver.MarkSeenReceiver
|
||||
import dev.octoshrimpy.quik.receiver.RemoteMessagingReceiver
|
||||
import dev.octoshrimpy.quik.receiver.SpeakThreadsReceiver
|
||||
import dev.octoshrimpy.quik.repository.ConversationRepository
|
||||
import dev.octoshrimpy.quik.repository.MessageRepository
|
||||
import dev.octoshrimpy.quik.util.GlideApp
|
||||
@@ -294,6 +295,14 @@ class NotificationManagerImpl @Inject constructor(
|
||||
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_CALL).build()
|
||||
}
|
||||
|
||||
Preferences.NOTIFICATION_ACTION_SPEAK -> {
|
||||
val intent = Intent(context, SpeakThreadsReceiver::class.java).putExtra("threadId", threadId)
|
||||
val pi = PendingIntent.getBroadcast(context, 0, intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
|
||||
NotificationCompat.Action.Builder(R.drawable.ic_speaker_black_24dp, actionLabels[action], pi)
|
||||
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_NONE).build()
|
||||
}
|
||||
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,6 +410,7 @@
|
||||
<item>Call</item>
|
||||
<item>Mark read</item>
|
||||
<item>Reply</item>
|
||||
<item>Speak</item>
|
||||
</string-array>
|
||||
|
||||
<string name="button_yes">Yes</string>
|
||||
|
||||
Reference in New Issue
Block a user