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.

The Sceyt Chat UIKit abstracts every screen transition through a Destination sealed class and a SceytChatUIKitNavigator interface. Rather than hard-coding startActivity calls throughout your codebase, UIKit calls SceytChatUIKit.navigator.resolve(destination) before launching any screen. Your app can intercept any route at that single point, replace the destination with a custom one, or wrap the navigation in your own back-stack management.

The SceytChatUIKitNavigator Interface

interface SceytChatUIKitNavigator {
    fun resolve(destination: Destination): Destination = destination
}
The default implementation (DefaultSceytChatUIKitNavigator) simply returns the destination unchanged. Override resolve to intercept specific destinations and return a modified or replaced one. To activate your navigator, assign it before the first screen is opened:
SceytChatUIKit.navigator = MyAppNavigator()

Extension Functions

Two extension functions on SceytChatUIKitNavigator drive all navigation calls inside UIKit:
FunctionUsage
navigate(context, destination)One-way navigation — calls resolve, then destination.navigate(context)
navigateForResult(context, launcher, destination)Result navigation — calls resolve, then launches via ActivityResultLauncher

The Destination Sealed Class

Every UIKit route is represented as a subclass of Destination. Each subclass owns a createIntent(context: Context): Intent factory and optional createOptions(context: Context): ActivityOptionsCompat for transitions.
Opens a chat channel conversation.
Destination.Channel(
    channel: SceytChannel,
    targetMessageId: Long? = null   // Scroll to this message on open
)
Opens channel details, optionally activating message search mode.
Destination.ChannelInfo(
    channel: SceytChannel,
    enableSearchMessages: Boolean = false
)
Opens the UIKit start-chat entry screen (user picker for new conversations).
Destination.StartChat()
Opens the one-to-one channel creation flow.
Destination.CreateChannel()
Opens the group creation flow with a pre-selected list of members.
Destination.CreateGroup(members: List<SceytMember>)
Opens the generic user-selection screen driven by SelectUsersPageArgs.
Destination.SelectUsers(args: SelectUsersPageArgs)
Opens the global message search screen. When an Activity context and a sourceView are provided, a shared-element transition is used automatically.
Destination.GlobalSearch(sourceView: View? = null)
Opens the delivery and read-receipt info screen for a specific message.
Destination.MessageInfo(
    message: SceytMessage,
    itemStyle: MessageItemStyle
)
Opens the forwarding flow for one or more messages.
Destination.Forward(messages: List<SceytMessage>)
// Convenience vararg constructor:
Destination.Forward(vararg messages: SceytMessage)
Opens the poll result detail screen for a message.
Destination.PollResults(message: SceytMessage)
Opens the poll creation screen for the target channel.
Destination.CreatePoll(channelId: ChannelId)
Opens a lightweight full-screen image preview.
Destination.ImagePreview(
    imageUrl: String,
    toolbarTitle: CharSequence
)
Opens the self-destructing media attachment viewer.
Destination.SelfDestructingMediaPreview(
    message: SceytMessage,
    attachment: SceytAttachment
)
Opens the self-destructing voice message player.
Destination.SelfDestructingVoicePreview(
    message: SceytMessage,
    attachment: SceytAttachment,
    styleId: String
)
Opens the full-screen media viewer. Accepts either a single attachment or a preloaded list for swipe-through browsing. Optionally provide a sourceView for a shared-element transition.
// Single attachment:
Destination.MediaPreview(
    params = MediaPreviewParams.SingleAttachment(
        attachment = attachment,
        from = senderUser,
        channelId = channel.id,
        reversed = false,
        showInChatChannel = channel,  // optional
        sourceView = thumbnailView    // optional, enables shared transition
    )
)

// Preloaded list:
Destination.MediaPreview(
    params = MediaPreviewParams.PreloadedList(
        items = attachmentList,
        initialIndex = 0,
        showInChatChannel = channel,
        sourceView = thumbnailView
    )
)
Opens the preview screen shown after capturing media with the built-in camera.
Destination.CameraMediaPreview(
    filePath: String,
    isVideo: Boolean
)
Opens UIKit’s built-in camera screen with an optional allowed-mode constraint.
Destination.CustomCamera(allowedMode: CameraState.AllowedMode? = null)
Opens the host app’s launcher / root activity. UIKit uses this as a safe fallback for task-root exits and notification entry points.
Destination.AppRoot(flags: Int = 0)

Replacing a Destination

The recommended pattern is to subclass the built-in destination (it is open) and override createIntent — then return your subclass from resolve.

Example: Open a Custom Channel Activity

import android.content.Context
import android.content.Intent
import com.sceyt.chatuikit.data.models.channels.SceytChannel
import com.sceyt.chatuikit.navigation.Destination
import com.sceyt.chatuikit.navigation.SceytChatUIKitNavigator

class MyAppNavigator : SceytChatUIKitNavigator {

    override fun resolve(destination: Destination): Destination {
        return when (destination) {
            is Destination.Channel -> MyChannelDestination(destination.channel, destination.targetMessageId)
            else -> destination  // Keep all other destinations as-is
        }
    }
}

class MyChannelDestination(
    channel: SceytChannel,
    targetMessageId: Long? = null,
) : Destination.Channel(channel, targetMessageId) {

    override fun createIntent(context: Context): Intent {
        // Replace with your own Activity
        return Intent(context, MyCustomChannelActivity::class.java).apply {
            putExtra("channel_id", channel.id)
            targetMessageId?.let { putExtra("target_message_id", it) }
        }
    }
}
Apply the navigator during application startup:
class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        SceytChatUIKit.initialize(this, apiUrl, appId, clientId)
        SceytChatUIKit.navigator = MyAppNavigator()
    }
}
Override createOptions(context) in your custom destination if you also want to change the transition animation or use a shared-element transition.

Build docs developers (and LLMs) love