From 201a6480a22e0f7ccec45d8ec9f432d22ec06b14 Mon Sep 17 00:00:00 2001 From: Jackson E J Date: Thu, 17 Oct 2024 16:04:38 +0530 Subject: [PATCH] fix issue in user display initials --- .../main/java/live/hms/roomkit/ui/meeting/PreviewFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/room-kit/src/main/java/live/hms/roomkit/ui/meeting/PreviewFragment.kt b/room-kit/src/main/java/live/hms/roomkit/ui/meeting/PreviewFragment.kt index 193523e71..f08fa9f01 100644 --- a/room-kit/src/main/java/live/hms/roomkit/ui/meeting/PreviewFragment.kt +++ b/room-kit/src/main/java/live/hms/roomkit/ui/meeting/PreviewFragment.kt @@ -652,7 +652,8 @@ class PreviewFragment : Fragment() { if (setTextOnce.not()) { setupUI(room.localPeer?.hmsRole?.name.orEmpty()) binding.nameInitials.visibility = View.VISIBLE - room.localPeer?.name?.let { binding.nameInitials.text = it } + val initials = kotlin.runCatching { NameUtils.getInitials(room.localPeer?.name ?: "") } + binding.nameInitials.text = initials.getOrNull().orEmpty() binding.editTextName.setText( room.localPeer?.name.orEmpty(), TextView.BufferType.EDITABLE )