From f68bc5477110a121ce6d51c7c2a7a77f3d6ea55b Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Wed, 18 Aug 2021 12:45:33 +0200 Subject: [PATCH] Update Context.kt --- .../smsmessenger/extensions/Context.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt index 1b1a7448..f32db870 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt @@ -710,13 +710,13 @@ fun Context.showMessageNotification(address: String, body: String, threadId: Lon val largeIcon = bitmap ?: SimpleContactsHelper(this).getContactLetterIcon(sender) val builder = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL).apply { - when (config.notificationSetting) { - CONFIGURE_NAME_AND_MESSAGE -> { + when (config.lockScreenVisibilitySetting) { + LOCK_SCREEN_SENDER_MESSAGE -> { setContentTitle(sender) setLargeIcon(largeIcon) setContentText(body) } - CONFIGURE_NAME -> { + LOCK_SCREEN_SENDER -> { setContentTitle(sender) setLargeIcon(largeIcon) } @@ -733,7 +733,7 @@ fun Context.showMessageNotification(address: String, body: String, threadId: Lon 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) } @@ -743,10 +743,10 @@ fun Context.showMessageNotification(address: String, body: String, threadId: Lon notificationManager.notify(threadId.hashCode(), builder.build()) } -fun Context.getConfigurationText(type: Int) = getString( +fun Context.getLockScreenVisibilityText(type: Int) = getString( when (type) { - CONFIGURE_NAME_AND_MESSAGE -> R.string.sender_and_message - CONFIGURE_NAME -> R.string.sender_only + LOCK_SCREEN_SENDER_MESSAGE -> R.string.sender_and_message + LOCK_SCREEN_SENDER -> R.string.sender_only else -> R.string.nothing } )