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.

Global Search lets users find channels, messages, media, files, voice messages, and links from a single unified search screen. The UIKit ships GlobalSearchActivity — a full-screen, tab-based search experience with a smooth shared-element transition from a search bar in the channel list, optional user-suggestion chips, and configurable debounce and auto-close behaviour. Opening it requires a single Destination.GlobalSearch call.

Opening GlobalSearchActivity

Use Destination.GlobalSearch through the UIKit navigator:
import com.sceyt.chatuikit.SceytChatUIKit
import com.sceyt.chatuikit.navigation.Destination
import com.sceyt.chatuikit.navigation.navigate

SceytChatUIKit.navigator.navigate(
    context,
    Destination.GlobalSearch()
)
When you pass the search bar View as sourceView, GlobalSearchActivity uses a shared-element scene transition. The search input expands smoothly from the source view into the full-screen search bar:
// e.g., called from a search icon or search bar click listener
SceytChatUIKit.navigator.navigate(
    context,                                // must be an Activity context
    Destination.GlobalSearch(sourceView = searchBarView)
)
ChannelListFragment uses this pattern automatically when the user taps the search bar at the top of the channel list. The View passed as sourceView must have the shared transition name GlobalSearchActivity.SHARED_TRANSITION_NAME set in XML or code for the animation to work:
<View
    android:id="@+id/searchView"
    android:transitionName="@string/sceyt_global_search_bar"
    ... />
// or programmatically:
searchBarView.transitionName = GlobalSearchActivity.SHARED_TRANSITION_NAME
The shared-element transition is only activated when both a non-null sourceView and an Activity context are provided. If either is absent, the UIKit falls back to its standard slide-in-right animation.

Search tabs

GlobalSearchActivity displays results in a horizontal tab bar backed by a ViewPager2. The default tabs are:
TabContent
ChatsMessages matching the query inside joined channels
ChannelsPublic and joined channels matching the query
MediaPhoto and video attachments
FilesFile attachments
VoiceVoice message attachments
LinksShared links
Each tab is a self-contained Fragment (ChatsSearchFragment, ChannelsSearchFragment, MediaSearchFragment, FilesSearchFragment, VoiceSearchFragment, LinksSearchFragment). You can change which tabs appear by subclassing GlobalSearchActivity and overriding provideTabs():
import com.sceyt.chatuikit.presentation.components.global_search.GlobalSearchActivity
import com.sceyt.chatuikit.presentation.components.global_search.GlobalSearchTab

class MyGlobalSearchActivity : GlobalSearchActivity() {

    override fun provideTabs(): List<GlobalSearchTab> {
        // Show only Chats and Channels tabs
        return listOf(GlobalSearchTab.Chats, GlobalSearchTab.Channels)
    }
}

GlobalSearchConfig — configuring search behaviour

Search behaviour is controlled by GlobalSearchConfig inside SceytChatUIKitConfig. Configure it once during SDK initialisation, typically in Application.onCreate():
import com.sceyt.chatuikit.SceytChatUIKit
import com.sceyt.chatuikit.config.GlobalSearchConfig
import com.sceyt.chatuikit.config.GlobalSearchCloseBehavior

SceytChatUIKit.config.globalSearchConfig = GlobalSearchConfig().apply {
    // Maximum number of user suggestion chips to show (default: 8)
    userSuggestionsLimit = 8

    // Debounce delay in ms before a search query is fired (default: 300)
    searchInputDebounceMs = 300

    // When to auto-close the search screen (default: OnMessageSent)
    closeBehavior = GlobalSearchCloseBehavior.OnMessageSent
}

GlobalSearchCloseBehavior options

ValueBehaviour
NeverThe search screen stays open until the user presses Back
OnChannelOpenCloses when the user taps a channel, message, or media result
OnMessageSentCloses when an outgoing message is detected on any channel

The SearchChannelParams data class controls how channel-name queries are matched. Set it via the channelListConfig or pass it directly to your custom search logic:
import com.sceyt.chatuikit.config.SearchChannelParams
import com.sceyt.chat.models.SearchQueryOperator
import com.sceyt.chat.models.channel.ChannelListQuery.ChannelListFilterKey

// The built-in default:
val defaultParams = SearchChannelParams.default
// SearchQueryOperator.SearchQueryOperatorContains
// ChannelListFilterKey.ListQueryChannelFilterKeySubject

// Custom example — prefix match on subject:
val customParams = SearchChannelParams(
    queryType = SearchQueryOperator.SearchQueryOperatorBeginsWith,
    filterKey   = ChannelListFilterKey.ListQueryChannelFilterKeySubject
)

User suggestions

While the search input is empty, GlobalSearchActivity displays horizontal user-suggestion chips sourced from GlobalSearchUserSuggestionsProvider. The built-in DefaultUserSuggestionsProvider returns the most recently active contacts. Replace it by overriding getUserSuggestionsProvider() in a subclass:
class MyGlobalSearchActivity : GlobalSearchActivity() {

    override fun getUserSuggestionsProvider(): GlobalSearchUserSuggestionsProvider {
        return MyCustomSuggestionsProvider()
    }
}

Subclassing GlobalSearchActivity

Override any open method to customise individual parts of the screen while keeping everything else:
class MyGlobalSearchActivity : GlobalSearchActivity() {

    // Use a custom style
    override fun buildStyle(): GlobalSearchStyle {
        return GlobalSearchStyle.Builder(this).build().let { style ->
            // modify style properties here
            style
        }
    }

    // React to channel taps
    override fun onChannelClicked(channel: SceytChannel) {
        // default navigates to Destination.Channel(channel)
        super.onChannelClicked(channel)
    }

    // React to message taps
    override fun onMessageClicked(messageId: Long, channel: SceytChannel) {
        // default navigates to Destination.Channel(channel, messageId)
        super.onMessageClicked(messageId, channel)
    }
}
Register the subclass with the navigator so the UIKit router uses it everywhere:
SceytChatUIKit.navigator.resolve = { destination ->
    when (destination) {
        is Destination.GlobalSearch -> MyGlobalSearchDestination(destination.sourceView)
        else -> destination
    }
}

Build docs developers (and LLMs) love