mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-02-18 12:40:46 +01:00
Update Context.kt
This commit is contained in:
parent
b65a78394e
commit
f68bc54771
@ -710,13 +710,13 @@ fun Context.showMessageNotification(address: String, body: String, threadId: Lon
|
|||||||
|
|
||||||
val largeIcon = bitmap ?: SimpleContactsHelper(this).getContactLetterIcon(sender)
|
val largeIcon = bitmap ?: SimpleContactsHelper(this).getContactLetterIcon(sender)
|
||||||
val builder = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL).apply {
|
val builder = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL).apply {
|
||||||
when (config.notificationSetting) {
|
when (config.lockScreenVisibilitySetting) {
|
||||||
CONFIGURE_NAME_AND_MESSAGE -> {
|
LOCK_SCREEN_SENDER_MESSAGE -> {
|
||||||
setContentTitle(sender)
|
setContentTitle(sender)
|
||||||
setLargeIcon(largeIcon)
|
setLargeIcon(largeIcon)
|
||||||
setContentText(body)
|
setContentText(body)
|
||||||
}
|
}
|
||||||
CONFIGURE_NAME -> {
|
LOCK_SCREEN_SENDER -> {
|
||||||
setContentTitle(sender)
|
setContentTitle(sender)
|
||||||
setLargeIcon(largeIcon)
|
setLargeIcon(largeIcon)
|
||||||
}
|
}
|
||||||
@ -733,7 +733,7 @@ fun Context.showMessageNotification(address: String, body: String, threadId: Lon
|
|||||||
setSound(soundUri, AudioManager.STREAM_NOTIFICATION)
|
setSound(soundUri, AudioManager.STREAM_NOTIFICATION)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (replyAction != null && config.notificationSetting == CONFIGURE_NAME_AND_MESSAGE) {
|
if (replyAction != null && config.lockScreenVisibilitySetting == LOCK_SCREEN_SENDER_MESSAGE) {
|
||||||
builder.addAction(replyAction)
|
builder.addAction(replyAction)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -743,10 +743,10 @@ fun Context.showMessageNotification(address: String, body: String, threadId: Lon
|
|||||||
notificationManager.notify(threadId.hashCode(), builder.build())
|
notificationManager.notify(threadId.hashCode(), builder.build())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.getConfigurationText(type: Int) = getString(
|
fun Context.getLockScreenVisibilityText(type: Int) = getString(
|
||||||
when (type) {
|
when (type) {
|
||||||
CONFIGURE_NAME_AND_MESSAGE -> R.string.sender_and_message
|
LOCK_SCREEN_SENDER_MESSAGE -> R.string.sender_and_message
|
||||||
CONFIGURE_NAME -> R.string.sender_only
|
LOCK_SCREEN_SENDER -> R.string.sender_only
|
||||||
else -> R.string.nothing
|
else -> R.string.nothing
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user