mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00: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:
commit
fe34cb11dd
1 changed files with 1 additions and 1 deletions
|
|
@ -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("")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue