/ UIKit / Android
UIKit
Chat UIKit Android v3
Chat UIKit Android
Chat UIKit
Android
Version 3

Typing indicator

Copy link

Typing indicator is a feature that allows users to know visually if another user in the channel is typing a message. The indicator remains visible until the user sends the message or deletes the text completely. It will also disappear when the user stops typing for more than 10 seconds.


We support two types of typing indicators: Text and Bubble.

Note: In order to use the typing indicator feature, you must first create a channel and enable the chat service. To learn how to allow users to chat in a channel, refer to the Chat in a group channel page.

The text typing indicator can be used in the following places.

Bubble

Copy link

The bubble typing indicator can be used in the following place.

Note that the bubble typing indicator is not supported in the ChannelListModule.


How to use in channel

Copy link

You can enable text and bubble typing indicators in your channel by following the code below. By default, the .Text type of typing indicator is turned on. However, you can also enable the .Bubble type here, or use both types at the same time.

kotlinJava
UIKitConfig.groupChannelConfig.enableTypingIndicator = true
UIKitConfig.groupChannelConfig.typingIndicatorTypes = setOf(TypingIndicatorType.BUBBLE, TypingIndicatorType.TEXT)

How to use in channel list

Copy link

You can enable the text typing indicator in the channel list by following the code below. You need to set the feature's setter method to true in ChannelListModule. The bubble typing indicator is not supported in this module.

kotlinJava
UIKitConfig.groupChannelListConfig.enableTypingIndicator = true

Customize the text typing indicator UI

Copy link

The UI for typing indicator can be customized through the string resource. The string resource is a set of strings used to compose the screen. It’s a res/strings.xml file containing UIKit-defined string values.

Text strings for typing status can vary depending on the number of members typing in a channel:

  • If one member is typing: “Member is typing...”
  • If two members are simultaneously typing: “Member A and Member B are typing...”
  • If more than two members are simultaneously typing: “Several people are typing...”

String resource

Copy link
<resources>
    <string name="sb_text_channel_typing_indicator_single">%s is typing&#8230;</string>
    <string name="sb_text_channel_typing_indicator_double">%s and %s are typing&#8230;</string>
    <string name="sb_text_channel_typing_indicator_multiple">Several people are typing&#8230;</string>
</resources>