avoid showing accent characters at contact image placeholders
This commit is contained in:
parent
718afea9d6
commit
0eb161e05a
|
@ -463,7 +463,7 @@ fun Context.showReceivedMessageNotification(address: String, body: String, threa
|
|||
val summaryText = getString(R.string.new_message)
|
||||
val sender = getNameAndPhotoFromPhoneNumber(address)?.name ?: ""
|
||||
|
||||
val largeIcon = bitmap ?: getNotificationLetterIcon(sender.toCharArray().getOrNull(0)?.toString() ?: "S")
|
||||
val largeIcon = bitmap ?: getNotificationLetterIcon(sender.getNameLetter())
|
||||
val builder = NotificationCompat.Builder(this, channelId)
|
||||
.setContentTitle(sender)
|
||||
.setContentText(body)
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
package com.simplemobiletools.smsmessenger.extensions
|
||||
|
||||
import com.simplemobiletools.commons.extensions.normalizeString
|
||||
|
||||
// get the contact names first letter at showing the placeholder without image
|
||||
fun String.getNameLetter() = normalizeString().toCharArray().getOrNull(0)?.toString() ?: "S"
|
Loading…
Reference in New Issue