presentation (1 of 3)
no.kindly.chatsdk.chat.presentation
ChatSDKActivity
class
class ChatSDKActivity : ComponentActivityMember | Declaration | Description |
|---|---|---|
ChatSDKActivity | constructor() | |
ChatSDKActivity.Companion
object
object CompanionhtmlToPlainText
function
fun String.htmlToPlainText(): Stringno.kindly.chatsdk.chat.presentation.chat
ConversationScreenWrapper
function
@Composable
fun ConversationScreenWrapper()Top-level chat screen: conversation message list + input + chat top bar (with its 3-dot menu) + an optional feedback bottom sheet overlay. This is the composable that the navigation host actually renders for the conversation route.
Owns indexes 0 (Settings) and 1 (Cancel chat) of its top-bar menu; everything after that is delegated to HandleLocalDevMenuItem so the labels and handlers stay in lock-step with MainScreen's parallel menu.
ConversationUiState
sealed class
sealed class ConversationUiStateThe states of UI for the Conversation screen
ConversationUiState.ClosingState
object
object ClosingState : ConversationUiStateConversationUiState.ErrorConnectionState
object
object ErrorConnectionState : ConversationUiStateConversationUiState.LoadingState
object
object LoadingState : ConversationUiStateConversationUiState.MessageSentErrorState
object
object MessageSentErrorState : ConversationUiStateConversationUiState.MessagesState
data class
data class MessagesState(val messageListType: List<MessageChat>, val action: Action? = null) : ConversationUiStateMember | Declaration | Description |
|---|---|---|
MessagesState | constructor(messageListType: List<MessageChat>, action: Action? = null) | |
action | val action: Action? | |
messageListType | val messageListType: List<MessageChat> | |
equals | open operator override fun equals(other: Any?): Boolean | |
hashCode | open override fun hashCode(): Int | |
ConversationUiState.ServerError
data class
data class ServerError(val errorString: String) : ConversationUiStateMember | Declaration | Description |
|---|---|---|
ServerError | constructor(errorString: String) | |
errorString | val errorString: String | |
ConversationUiState.UploadFileState
object
object UploadFileState : ConversationUiStateno.kindly.chatsdk.chat.presentation.chat.components
ButtonActions
enum
enum ButtonActionsMember | Declaration | Description |
|---|---|---|
link | link | |
dialogue_trigger | dialogue_trigger | |
phone | phone | |
quick_reply | quick_reply | |
| ||
abort_followup | abort_followup | |
takeover_request | takeover_request | |
upload_attachment | upload_attachment | |
end_chat | end_chat | |
privacy_export | privacy_export | |
privacy_delete | privacy_delete | |
contact_details | contact_details | |
checkbox | checkbox | |
slider | slider | |
submit | submit | |
valueOf | open fun valueOf(name: String): ButtonActions | Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) Returns - the enum constant with the specified name Throws - java.lang.IllegalArgumentException: if this enum type has no constant with the specified name |
values | open fun values(): Array<ButtonActions> | Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. Returns - an array containing the constants of this enum type, in the order they're declared |
ButtonState
enum
enum ButtonState : Enum<ButtonState>Button state enumeration
Member | Declaration | Description |
|---|---|---|
Normal | Normal | |
Loading | Loading | |
entries | val entries: EnumEntries<ButtonState> | Returns a representation of an immutable list of all enum entries, in the order they're declared. This method may be used to iterate over the enum entries. |
valueOf | fun valueOf(value: String): ButtonState | Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) Throws - kotlin.IllegalArgumentException: if this enum type has no constant with the specified name |
values | fun values(): Array<ButtonState> | Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. |
ComplianceEventMessageUI
function
@Composable
fun ComplianceEventMessageUI(message: String, onRevokeClick: () -> Unit, testTag: String = "compliance_event_message")ComplianceEventMessageUILegacy
function
@Composable
fun ComplianceEventMessageUILegacy(message: String, onRevokeClick: () -> Unit, testTag: String = "")ComposeKindlyButton
function
@Preview
@Composable
fun ComposeKindlyButton()ConstraintAgent
function
@Composable
fun ConstraintAgent(img: String, msg: String)ConversationWrapper
function
@Composable
fun ConversationWrapper()EventMessageUI
function
@Composable
fun EventMessageUI(message: String, @DrawableRes drawableResource: Int? = null, testTag: String = "event_message")htmlToString
function
fun htmlToString(text: String, msgFormat: MessageFormatType? = MessageFormatType.TXT): StringKindlyButton
function
@Composable
fun KindlyButton(modifier: Modifier, @DrawableRes drawableRes: Int? = null, text: String, onClick: () -> Unit, textColor: Color = ColorKindly.getKindlyColor(ItemColor.ColorButtonText), enabled: Boolean = true, state: ButtonState = ButtonState.Normal, testTagValue: String? = null, colors: ButtonColors = ButtonDefaults.outlinedButtonColors( containerColor = ColorKindly.getKindlyColor(ItemColor.ColorButtonBackground), contentColor = ColorKindly.getKindlyColor(ItemColor.ColorButtonText), disabledContainerColor = ColorKindly.getKindlyColor(ItemColor.ColorButtonBackground), disabledContentColor = ColorKindly.getKindlyColor(ItemColor.ColorButtonText).copy(alpha = 0.6f), ))MessageAgent
function
@Composable
fun MessageAgent(img: String, msg: String, testTag: String = "message_agent")PreviewConversationScreen
function
@Preview(showBackground = true, locale = "en-US")
@Composable
fun PreviewConversationScreen()no.kindly.chatsdk.chat.presentation.chat.components.ui
FlowLayout
function
@Composable
fun FlowLayout(modifier: Modifier = Modifier, content: @Composable () -> Unit)insertSuperscriptsIntoHtml
function
fun insertSuperscriptsIntoHtml(originalHtml: String, references: List<ChatMessageReferenceModel>?): StringmapPlainTextOffsetToHtmlOffset
function
fun mapPlainTextOffsetToHtmlOffset(plainOffset: Int, htmlText: String): Int?SourcesTagView
function
@Composable
fun SourcesTagView(sources: List<ChatMessageReferenceModel>, modifier: Modifier = Modifier)SourceTag
function
@Composable
fun SourceTag(index: Int, reference: ChatMessageReferenceModel, modifier: Modifier = Modifier)TextMessageContent
function
@Composable
fun TextMessageContent(msg: String, messageFormat: MessageFormatType, isMine: Boolean, messageReferences: List<ChatMessageReferenceModel>? = null)no.kindly.chatsdk.chat.presentation.chat.components.ui.form
createComponent
function
@Composable
fun createComponent(field: FormFieldDTO, formFields: MutableMap<String, FormFieldValue?>): @Composable () -> Unit?FormFieldValue
sealed class
sealed class FormFieldValueMember | Declaration | Description |
|---|---|---|
isImageEmpty | fun isImageEmpty(): Boolean | |
FormFieldValue.Files
data class
data class Files(val uris: List<Uri>) : FormFieldValueMember | Declaration | Description |
|---|---|---|
Files | constructor(uris: List<Uri>) | |
uris | val uris: List<Uri> | |
FormFieldValue.Image
data class
data class Image(val uri: Uri) : FormFieldValueMember | Declaration | Description |
|---|---|---|
Image | constructor(uri: Uri) | |
uri | val uri: Uri | |
FormFieldValue.MultipleSelection
data class
data class MultipleSelection(val selectedValues: List<String>) : FormFieldValueMember | Declaration | Description |
|---|---|---|
MultipleSelection | constructor(selectedValues: List<String>) | |
selectedValues | val selectedValues: List<String> | |
FormFieldValue.Text
data class
data class Text(val value: String, val displayValue: String? = null) : FormFieldValueMember | Declaration | Description |
|---|---|---|
Text | constructor(value: String, displayValue: String? = null) | |
displayValue | val displayValue: String? | |
value | val value: String | |
no.kindly.chatsdk.chat.presentation.chat.components.ui.form.components
CheckboxComponent
function
@Composable
fun CheckboxComponent(options: List<String>, selectedOptions: List<String>, onOptionToggled: (String, Boolean) -> Unit, checkedColor: Color = Color.Blue, uncheckedColor: Color = Color.Gray)Parameters
- checkedColor: Tick colour. Defaults to the original hardcoded blue; bot dialogue checkbox buttons pass the bot's themed colour so they match the rest of the chat.
- uncheckedColor: Outline colour when unchecked. Defaults to the original grey.
DropdownComponent
function
@Composable
fun DropdownComponent(input: DropdownData)DropdownData
data class
data class DropdownData(val selectedIndex: Int? = null, val labels: List<String> = emptyList(), val values: List<String> = emptyList(), val placeholder: String = "", val backgroundColor: Color? = null, val onValueChanged: (String, String) -> Unit = { _, _ -> })Member | Declaration | Description |
|---|---|---|
DropdownData | constructor(selectedIndex: Int? = null, labels: List<String> = emptyList(), values: List<String> = emptyList(), placeholder: String = "", backgroundColor: Color? = null, onValueChanged: (String, String) -> Unit = { _, _ -> }) | |
accessibilityId | val accessibilityId: String | Generates a unique accessibility identifier for Appium automation Format: dropdown_placeholder_selected_label |
backgroundColor | val backgroundColor: Color? | |
labels | val labels: List<String> | |
onValueChanged | val onValueChanged: (String, String) -> Unit | |
placeholder | val placeholder: String | |
selectedIndex | val selectedIndex: Int? | |
values | val values: List<String> | |
ExtendedTextInputData
data class
data class ExtendedTextInputData(val label: String, val required: Boolean = false, val helpText: String? = null, val text: String? = null, val placeholder: String? = null, val keyboardType: KeyboardOptions = KeyboardOptions.Default.copy(keyboardType = KeyboardType.Text), val minimum: Int? = null, val maximum: Int? = null, val characterLimit: Int? = null, val inputType: InputType = InputType.TEXT)Member | Declaration | Description |
|---|---|---|
ExtendedTextInputData | constructor(label: String, required: Boolean = false, helpText: String? = null, text: String? = null, placeholder: String? = null, keyboardType: KeyboardOptions = KeyboardOptions.Default.copy(keyboardType = KeyboardType.Text), minimum: Int? = null, maximum: Int? = null, characterLimit: Int? = null, inputType: InputType = InputType.TEXT) | |
characterLimit | val characterLimit: Int? | |
helpText | val helpText: String? | |
inputType | val inputType: InputType | |
keyboardType | val keyboardType: KeyboardOptions | |
label | val label: String | |
maximum | val maximum: Int? | |
minimum | val minimum: Int? | |
placeholder | val placeholder: String? | |
required | val required: Boolean | |
text | val text: String? | |
toTextInputData | fun toTextInputData(): TextInputData | |
FileUploadComponent
function
@Composable
fun FileUploadComponent(input: FileUploadData)FileUploadData
data class
data class FileUploadData(val title: String = "Upload Image", val maxFiles: Int = 5, val onFilesChanged: (List<Uri>) -> Unit = {})Member | Declaration | Description |
|---|---|---|
FileUploadData | constructor(title: String = "Upload Image", maxFiles: Int = 5, onFilesChanged: (List<Uri>) -> Unit = {}) | |
accessibilityId | val accessibilityId: String | |
maxFiles | val maxFiles: Int | |
onFilesChanged | val onFilesChanged: (List<Uri>) -> Unit | |
title | val title: String | |
HelpText
function
@Composable
fun HelpText(helpText: String?)InputType
enum
enum InputType : Enum<InputType>Member | Declaration | Description |
|---|---|---|
TEXT | TEXT | |
| ||
NUMBER | NUMBER | |
entries | val entries: EnumEntries<InputType> | Returns a representation of an immutable list of all enum entries, in the order they're declared. This method may be used to iterate over the enum entries. |
valueOf | fun valueOf(value: String): InputType | Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) Throws - kotlin.IllegalArgumentException: if this enum type has no constant with the specified name |
values | fun values(): Array<InputType> | Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. |
LabeledTextInput
function
@Composable
fun LabeledTextInput(input: ExtendedTextInputData)LabelText
function
@Composable
fun LabelText(label: String, required: Boolean = false)openSelectionDialog
function
@Composable
fun openSelectionDialog(showCameraOption: Boolean, showGalleryOption: Boolean, showFilesOption: Boolean = false, onCameraClick: () -> Unit, onGalleryClick: () -> Unit, onFilesClick: () -> Unit = {}, onDismiss: () -> Unit)RadioButtonComponent
function
@Composable
fun RadioButtonComponent(options: List<String>, selectedOption: String?, onOptionSelected: (String) -> Unit)RangeSliderComponent
function
@Composable
fun RangeSliderComponent(input: RangeSliderData)RangeSliderData
data class
data class RangeSliderData(val min: Float = 0.0f, val max: Float = 100.0f, val value: Float = 0.0f, val step: Float? = null, val onValueChanged: (Float) -> Unit = {}, val stateKey: Any? = null, val valueFormatter: (Float) -> String? = null)Member | Declaration | Description |
|---|---|---|
RangeSliderData | constructor(min: Float = 0.0f, max: Float = 100.0f, value: Float = 0.0f, step: Float? = null, onValueChanged: (Float) -> Unit = {}, stateKey: Any? = null, valueFormatter: (Float) -> String? = null) | |
accessibilityId | val accessibilityId: String | Generates a unique accessibility identifier for Appium automation Format: range_slider_min``max``value |
max | val max: Float | |
min | val min: Float | |
onValueChanged | val onValueChanged: (Float) -> Unit | |
stateKey | val stateKey: Any? | Optional stable identity for the slider's internal state. When set, the displayed value is re-seeded from value whenever the key changes — which lets a caller restore a previously chosen value after the slider has scrolled out of composition. Leave null (the default) for the original behaviour. |
step | val step: Float? | |
value | val value: Float | |
valueFormatter | val valueFormatter: (Float) -> String? | Optional renderer for the readout above the track, e.g. to add a currency prefix or show decimals. Defaults to the original whole-number rendering. |
formatValue | fun formatValue(number: Float): String | Renders number using valueFormatter, falling back to the original whole-number style. |
TextInputComponent
function
@Composable
fun TextInputComponent(input: TextInputData)TextInputData
data class
data class TextInputData(val text: String? = null, val placeholder: String? = null, val keyboardType: KeyboardOptions = KeyboardOptions.Default.copy(keyboardType = KeyboardType.Text), val minimum: Int? = null, val maximum: Int? = null, val characterLimit: Int? = null, val inputType: InputType = InputType.TEXT, val isMultiline: Boolean = false, val backgroundColor: Color? = null, val onTextChanged: (String) -> Unit? = {})Member | Declaration | Description |
|---|---|---|
TextInputData | constructor(text: String? = null, placeholder: String? = null, keyboardType: KeyboardOptions = KeyboardOptions.Default.copy(keyboardType = KeyboardType.Text), minimum: Int? = null, maximum: Int? = null, characterLimit: Int? = null, inputType: InputType = InputType.TEXT, isMultiline: Boolean = false, backgroundColor: Color? = null, onTextChanged: (String) -> Unit? = {}) | |
accessibilityId | val accessibilityId: String | Generates a unique accessibility identifier for Appium automation Format: text_input_inputType_placeholder |
backgroundColor | val backgroundColor: Color? | |
characterLimit | val characterLimit: Int? | |
inputType | val inputType: InputType | |
isMultiline | val isMultiline: Boolean | |
keyboardType | val keyboardType: KeyboardOptions | |
maximum | val maximum: Int? | |
minimum | val minimum: Int? | |
onTextChanged | val onTextChanged: (String) -> Unit? | |
placeholder | val placeholder: String? | |
text | val text: String? | |
no.kindly.chatsdk.chat.presentation.chat.components.ui.handover
EndHandoverConfirmation
function
@Composable
fun EndHandoverConfirmation(onDismiss: () -> Unit, onLeaveHandoverClicked: () -> Unit, modifier: Modifier = Modifier)no.kindly.chatsdk.chat.presentation.compliancebanner
ComplianceBanner
function
@Composable
fun ComplianceBanner(onAccept: () -> Unit, modifier: Modifier = Modifier)ComplianceContentView
function
@Composable
fun ComplianceContentView(languageSettings: ComplianceSettingsForLanguageSDK?, currentLanguageCode: String, textColor: Color, showIcon: Boolean = true, showButton: Boolean = true, useSafeAreaBottom: Boolean = false, buttonTextOverride: String? = null, onAccept: () -> Unit, modifier: Modifier = Modifier)no.kindly.chatsdk.chat.presentation.components
ActionSheetDialog
function
@Composable
fun ActionSheetDialog(title: String, message: String? = null, items: List<ActionSheetItem>, cancelButtonText: String = Localizations.getString(LocalContext.current, KindlyStringKey.CHAT_CANCEL_BUTTON), onDismiss: () -> Unit, modifier: Modifier = Modifier)Action Sheet Dialog similar to iOS UIActionSheet. Displays a list of flat, tappable rows with optional icons.
ActionSheetItem
data class
data class ActionSheetItem(val text: String, val icon: ImageVector? = null, @DrawableRes val drawableIcon: Int? = null, val type: ActionSheetItemType = ActionSheetItemType.DEFAULT, val onClick: () -> Unit)Member | Declaration | Description |
|---|---|---|
ActionSheetItem | constructor(text: String, icon: ImageVector? = null, @DrawableRes drawableIcon: Int? = null, type: ActionSheetItemType = ActionSheetItemType.DEFAULT, onClick: () -> Unit) | |
drawableIcon | val drawableIcon: Int? | |
icon | val icon: ImageVector? | |
onClick | val onClick: () -> Unit | |
text | val text: String | |
type | val type: ActionSheetItemType | |
ActionSheetItemType
enum
enum ActionSheetItemType : Enum<ActionSheetItemType>Action types for styling — matches iOS UIAlertAction.Style
Member | Declaration | Description |
|---|---|---|
DEFAULT | DEFAULT | Default action style |
DESTRUCTIVE | DESTRUCTIVE | Destructive action — displayed in red |
CANCEL | CANCEL | Cancel action — displayed with less emphasis |
entries | val entries: EnumEntries<ActionSheetItemType> | Returns a representation of an immutable list of all enum entries, in the order they're declared. This method may be used to iterate over the enum entries. |
valueOf | fun valueOf(value: String): ActionSheetItemType | Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) Throws - kotlin.IllegalArgumentException: if this enum type has no constant with the specified name |
values | fun values(): Array<ActionSheetItemType> | Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants. |
ChatTopBarMenu
function
@Composable
fun RowScope.ChatTopBarMenu(itemMenu: MutableState<Int>, menuItems: List<String>)The 3-dot menu button + its dropdown that lives in the chat top bar's actions slot. Self-contained: owns its own expanded state, builds the menu using the theme colors, and writes the selected index back into itemMenu for the host composable to dispatch.
Item index 1 (Cancel chat) is rendered in red; everything else uses the theme-aware readable text color. The host is expected to handle the actual actions for indexes 0 and 1; indexes 2+ are typically routed through HandleLocalDevMenuItem.
Parameters
- itemMenu: Backing state for the currently-selected menu index. Set to the chosen index when the user taps an item; reset to -1 by the host once the action has been processed.
- menuItems: The labels to display, in order. Build with localDevMenuItems() + your host-specific entries (e.g. Settings, Cancel).
CustomTopBar
function
@Composable
fun CustomTopBar(title: String, avatarUrl: String? = null, navigationIcon: Int? = R.drawable.kindly_ic_arrow_back, onNavigationClick: () -> Unit? = null, actions: @Composable RowScope.() -> Unit = {})Reusable CustomTopBar that can be added to any screen Provides the same UI as the current TopBar with full customization options
Parameters
- title: The main title text
- avatarUrl: Optional avatar URL (when provided, shows avatar + title like main chat)
- navigationIcon: Optional left navigation icon (defaults to back arrow)
- onNavigationClick: Callback for navigation icon click
- actions: Optional right side actions (icons, buttons, etc.)
GlobalConfirmationDialog
function
@Composable
fun GlobalConfirmationDialog(title: String, message: String, confirmButtonText: String, cancelButtonText: String = Localizations.getString(LocalContext.current, KindlyStringKey.CHAT_CANCEL_BUTTON), icon: ImageVector? = null, @DrawableRes drawableIcon: Int? = null, onConfirm: () -> Unit, onDismiss: () -> Unit, modifier: Modifier = Modifier)Global confirmation dialog that can be used throughout the app