mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-16 18:55:57 -04:00
Merge pull request #174 from timgunter/better_shortnames
Always keep first character of long name when making short name
This commit is contained in:
@@ -28,7 +28,7 @@ fun getInitials(nameIn: String): String {
|
||||
|
||||
val initials = when (words.size) {
|
||||
in 0..minchars - 1 -> {
|
||||
val nm = name.filterNot { c -> c.toLowerCase() in "aeiou" }
|
||||
val nm = name.first() + name.drop(1).filterNot { c -> c.toLowerCase() in "aeiou" }
|
||||
if (nm.length >= nchars) nm else name
|
||||
}
|
||||
else -> words.map { it.first() }.joinToString("")
|
||||
|
||||
Reference in New Issue
Block a user