mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
avoid showing accent characters at contact image placeholders
This commit is contained in:
@@ -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"
|
Reference in New Issue
Block a user