Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sceyt/sceyt-chat-android-uikit/llms.txt

Use this file to discover all available pages before exploring further.

Formatters control how raw data — users, channels, messages, attachments, dates, and push payloads — are turned into the strings and styled text that appear in the UIKit’s views. Every piece of human-readable text rendered by the UIKit passes through a formatter. By replacing individual formatters on SceytChatUIKit.formatters, you can change display names, date patterns, notification copy, badge labels, and more, without touching any layout XML or subclassing any view.

The Formatter<T> Interface

All formatters implement the Formatter functional interface:
fun interface Formatter<T> {
    fun format(context: Context, from: T): CharSequence
}
  • context — Android Context for resolving strings, colors, or locale information.
  • from — the input data object of type T.
  • Return value — a CharSequence, so you can return a plain String or a richly-styled SpannableString.
Two convenience type aliases are pre-defined:
typealias UserFormatter    = Formatter<SceytUser>
typealias ChannelFormatter = Formatter<SceytChannel>
For formatters that produce structured output (such as the combined status-and-date shown next to the last channel message), a TypedFormatter<T, R> variant is available that returns a typed R rather than CharSequence.

SceytChatUIKit.formatters

The SceytChatUIKit.formatters property holds a mutable SceytChatUIKitFormatters instance. Replace any formatter property on it to override the default behavior. Assignments should be made in Application.onCreate() before the UIKit renders its first view.
SceytChatUIKit.formatters.userNameFormatter = Formatter { context, user ->
    "${user.firstName} ${user.lastName}"
}

Formatter Reference

userPresenceDateFormatter
Formatter<SceytUser>
Formats the last-seen / presence date string shown beneath a user’s name (e.g., “Last seen 2 hours ago”). Default: DefaultUserPresenceDateFormatter.
userNameFormatter
Formatter<SceytUser>
Formats a user’s display name wherever their name appears (channel header, member lists, search results). Default: DefaultUserNameFormatter.
userShortNameFormatter
Formatter<SceytUser>
Formats an abbreviated version of the user’s name (e.g., initials or first name only). Default: DefaultUserShortNameFormatter.
userAndNotesNameFormatter
Formatter<SceytUser>
Formats the name shown in the “Notes to self” channel. Default: DefaultUserAndNotesNameFormatter.
mentionUserNameFormatter
Formatter<SceytUser>
Formats the @mention text for a user inside a message body. Default: DefaultMentionUserNameFormatter.
reactedUserNameFormatter
Formatter<SceytUser>
Formats the name shown in the reaction details list. Default: DefaultUserNameFormatter.
channelEventUserNameFormatter
Formatter<SceytUser>
Formats user names inside channel event messages (e.g., “Alice was added”). Default: DefaultChannelEventUserNameFormatter.
channelEventTitleFormatter
Formatter<ChannelEventTitleFormatterAttributes>
Formats the full title of a channel event message shown in the message thread. Default: DefaultChannelEventTitleFormatter.
channelListChannelEventTitleFormatter
Formatter<ChannelEventTitleFormatterAttributes>
Formats the channel event subtitle shown in the channel list row. Default: DefaultChannelListChannelEventTitleFormatter.
channelNameFormatter
Formatter<SceytChannel>
Formats the channel title used in the message thread header and channel info. Default: DefaultChannelNameFormatter.
channelSubtitleFormatter
Formatter<SceytChannel>
Formats the subtitle line in the message thread header (e.g., “3 members”, “online”). Default: DefaultChannelSubtitleFormatter.
channelListItemSubtitleFormatter
Formatter<ChannelItemSubtitleFormatterAttributes>
Formats the subtitle line within each channel list row. Default: DefaultChannelListSubtitleFormatter.
channelDateFormatter
Formatter<Date>
Formats the timestamp shown in the channel list row (e.g., “Mon”, “12:34”). Default: DefaultChannelDateFormatter.
channelLastMessageStatusAndDateFormatter
TypedFormatter<ChannelLastMessageStatusAndDateFormatterAttributes, ChannelLastMessageStatusAndDate>
Formats the combined delivery-status icon and date shown alongside the last message in the channel list. Returns a typed ChannelLastMessageStatusAndDate object. Default: DefaultChannelLastMessageStatusAndDateFormatter.
channelLastMessageSenderNameFormatter
Formatter<SceytChannel>
Formats the sender name prefix for the last message in a group channel (e.g., “Alice:”). Default: DefaultChannelLastMessageSenderNameFormatter.
messageBodyFormatter
Formatter<MessageBodyFormatterAttributes>
Formats the body text of a message as it appears in the message thread bubble. Default: DefaultMessageBodyFormatter.
channelLastMessageBodyFormatter
Formatter<MessageBodyFormatterAttributes>
Formats the last message body displayed in the channel list subtitle (may include attachment type). Default: DefaultMessageBodyWithAttachmentsFormatter.
channelDraftLastMessageBodyFormatter
Formatter<DraftMessageBodyFormatterAttributes>
Formats a draft message body shown as the last message in the channel list row. Default: DefaultDraftMessageBodyWithAttachmentsFormatter.
replyMessageBodyFormatter
Formatter<MessageBodyFormatterAttributes>
Formats the body of the message shown in the input bar reply preview. Default: DefaultMessageBodyWithAttachmentsFormatter.
repliedMessageBodyFormatter
Formatter<MessageBodyFormatterAttributes>
Formats the quoted body inside an already-sent reply bubble. Default: DefaultMessageBodyWithAttachmentsFormatter.
editMessageBodyFormatter
Formatter<MessageBodyFormatterAttributes>
Formats the message body while it is being edited in the input bar. Default: DefaultMessageBodyWithAttachmentsFormatter.
draftMessageBodyFormatter
Formatter<DraftMessageBodyFormatterAttributes>
Formats a saved draft message body. Default: DefaultDraftMessageBodyFormatter.
unsupportedMessageBodyFormatter
Formatter<SceytMessage>
Formats messages with an unrecognized type. Default: DefaultUnsupportedMessageBodyFormatter.
unsupportedMessageShortBodyFormatter
Formatter<SceytMessage>
Formats a short (single-line) version of an unsupported message body, used in previews and the channel list subtitle. Default: DefaultUnsupportedMessageBodyFormatter.
selfDestructedMessageBodyFormatter
Formatter<SceytMessage>
Formats the placeholder shown for a self-destructed (view-once) message after it has been opened. Default: DefaultSelfDestructedMessageBodyFormatter.
systemMessageBodyFormatter
Formatter<SceytMessage>
Formats system / event messages (join, leave, name changes) in the message thread. Default: DefaultSystemMessageBodyFormatter.
messageDateFormatter
Formatter<Date>
Formats the timestamp shown inside each message bubble. Default: DefaultMessageDateFormatter.
messageDateSeparatorFormatter
Formatter<Date>
Formats the date label displayed in date-separator rows between message groups. Default: DefaultMessageDateSeparatorFormatter.
messageInfoDateFormatter
Formatter<Date>
Formats the date shown in the message info / delivery status screen. Default: DefaultMessageInfoDateFormatter.
messageMarkerDateFormatter
Formatter<Date>
Formats the timestamp shown next to each read receipt marker in the message info screen. Default: DefaultMessageMarkerDateFormatter.
channelInfoAttachmentDateFormatter
Formatter<Date>
Formats the date label shown on attachment items in the channel info media/files/voice tabs. Default: DefaultAttachmentDateFormatter.
channelInfoDateSeparatorFormatter
Formatter<Date>
Formats the date separator headers between attachment groups in the channel info tabs. Default: DefaultChannelInfoDateSeparatorFormatter.
mediaPreviewDateFormatter
Formatter<Date>
Formats the date string displayed in the full-screen media preview overlay. Default: DefaultAttachmentDateFormatter.
channelInfoFileSubtitleFormatter
Formatter<SceytAttachment>
Formats the subtitle line shown beneath a file item in the channel info files tab (e.g., file size and date). Default: DefaultChannelInfoFileSubtitleFormatter.
channelInfoVoiceSubtitleFormatter
Formatter<SceytAttachment>
Formats the subtitle line shown beneath a voice message item in the channel info voice tab. Default: DefaultChannelInfoVoiceSubtitleFormatter.
messageViewCountFormatter
Formatter<Long>
Formats the view count label displayed on broadcast messages. Default: DefaultMessageViewCountFormatter.
mediaDurationFormatter
Formatter<Long>
Formats a duration in milliseconds as a human-readable string (e.g., “1:23”) for video and audio attachments. Default: DefaultMediaDurationFormatter.
voiceDurationFormatter
Formatter<Long>
Formats a voice message duration. Default: DefaultVoiceDurationFormatter.
attachmentNameFormatter
Formatter<SceytAttachment>
Formats the file name displayed for file attachments. Default: DefaultAttachmentNameFormatter.
attachmentSizeFormatter
Formatter<SceytAttachment>
Formats the file size label (e.g., “2.4 MB”) for file attachments. Default: DefaultAttachmentSizeFormatter.
unreadCountFormatter
Formatter<Long>
Formats the unread badge count (e.g., turning 1000 into “999+”). Default: DefaultUnreadCountFormatter.
notificationTitleFormatter
Formatter<PushData>
Formats the push notification title. Default: DefaultNotificationTitleFormatter.
notificationBodyFormatter
Formatter<PushData>
Formats the push notification body text. Default: DefaultNotificationBodyFormatter.
pollTypeFormatter
Formatter<SceytPollDetails>
Formats the poll type label shown in poll messages. Default: DefaultPollTypeFormatter.
pollVoteCountFormatter
Formatter<PollOptionUiModel>
Formats the vote count shown on each poll option. Default: DefaultPollVoteCountFormatter.
pollResultVoteCountFormatter
Formatter<Int>
Formats the total vote count shown in poll results. Default: DefaultPollResultVoteCountFormatter.
pollVoteDateFormatter
Formatter<Long>
Formats the date/time a vote was cast, displayed in the poll vote details screen. Default: DefaultPollVoteTimeDateFormatter.
connectionStateTitleFormatter
Formatter<ConnectionState>
Formats the connection-state banner text (e.g., “Connecting…”, “Reconnecting…”). Default: DefaultConnectionsStateTitleFormatter.
searchMessageResultBodyFormatter
Formatter<SearchMessageResultFormatterAttributes>
Formats a search result message body, typically with query highlights. Default: DefaultSearchMessageResultBodyFormatter.
searchMessageSenderNameFormatter
Formatter<SceytMessage>
Formats the sender name in a search result row. Default: DefaultSearchMessageSenderNameFormatter.
searchMessageDateFormatter
Formatter<Date>
Formats the date shown in a search result row. Default: DefaultSearchMessageDateFormatter.

Replacement Examples

Display Name

import com.sceyt.chatuikit.formatters.Formatter

SceytChatUIKit.formatters.userNameFormatter = Formatter { context, user ->
    buildString {
        if (!user.firstName.isNullOrBlank()) append(user.firstName)
        if (!user.lastName.isNullOrBlank()) {
            if (isNotEmpty()) append(" ")
            append(user.lastName)
        }
        if (isEmpty()) append(user.id)
    }
}

Custom Date Pattern

import java.text.SimpleDateFormat
import java.util.Locale

SceytChatUIKit.formatters.messageDateFormatter = Formatter { context, date ->
    SimpleDateFormat("h:mm a", Locale.getDefault()).format(date)
}

Push Notification Body

SceytChatUIKit.formatters.notificationBodyFormatter = Formatter { context, pushData ->
    val sender = pushData.user?.let { "${it.firstName} ${it.lastName}".trim() }
        ?: context.getString(R.string.someone)
    "$sender sent you a message"
}

Unread Count Badge

SceytChatUIKit.formatters.unreadCountFormatter = Formatter { context, count ->
    when {
        count >= 1000 -> "${count / 1000}k+"
        else          -> count.toString()
    }
}
All formatter assignments take effect immediately for any view that has not yet been created. Already-rendered views may need to be invalidated or their adapter notified to pick up the new formatter output.

Applying Formatters at Initialization

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        SceytChatUIKit.initialize(
            context        = this,
            apiUrl         = "https://us-ohio-api.sceyt.com",
            appId          = "your-app-id",
            clientId       = UUID.randomUUID().toString(),
            enableDatabase = true
        )

        with(SceytChatUIKit.formatters) {
            userNameFormatter = Formatter { _, user ->
                "${user.firstName} ${user.lastName}".trim().ifEmpty { user.id }
            }

            messageDateFormatter = Formatter { _, date ->
                SimpleDateFormat("h:mm a", Locale.getDefault()).format(date)
            }

            unreadCountFormatter = Formatter { _, count ->
                if (count > 99) "99+" else count.toString()
            }
        }
    }
}

Build docs developers (and LLMs) love