presentation (3 of 3)
no.kindly.chatsdk.chat.presentation.statusbar
StatusBarManager
class
class StatusBarManagerMember | Declaration | Description |
|---|---|---|
StatusBarManager | constructor() | |
hide | fun hide(identifier: String) | |
hideAll | fun hideAll() | |
register | fun register(statusBar: StatusBarProtocol) | |
show | fun show(identifier: String) | |
StatusBarStack | @Composable fun StatusBarStack(modifier: Modifier = Modifier) | |
unregister | fun unregister(statusBar: StatusBarProtocol) | |
StatusBarPriority
object
object StatusBarPriorityMember | Declaration | Description |
|---|---|---|
CONNECTION_ERROR | const val CONNECTION_ERROR: Int | |
CRITICAL | const val CRITICAL: Int = 300 | |
HANDOVER | const val HANDOVER: Int | |
HIGH | const val HIGH: Int = 200 | |
LOW | const val LOW: Int = 0 | |
MAINTENANCE | const val MAINTENANCE: Int | |
MEDIUM | const val MEDIUM: Int = 100 | |
NO_INTERNET | const val NO_INTERNET: Int | |
StatusBarProtocol
interface
interface StatusBarProtocolMember | Declaration | Description |
|---|---|---|
identifier | abstract val identifier: String | |
isVisible | abstract var isVisible: Boolean | |
priority | abstract val priority: Int | |
Content | @Composable abstract fun Content(modifier: Modifier) | |
onDidHide | open fun onDidHide() | |
onDidShow | open fun onDidShow() | |
onWillHide | open fun onWillHide() | |
onWillShow | open fun onWillShow() | |
no.kindly.chatsdk.chat.presentation.theme
ColorUtils
object
object ColorUtilsUtility functions for color operations and contrast checking.
Member | Declaration | Description |
|---|---|---|
calculateContrastRatio | fun calculateContrastRatio(color1: Color, color2: Color): Double | Calculates the contrast ratio between two colors. Parameters - color1: First color - color2: Second color Returns - The contrast ratio between the two colors |
calculateLuminance | fun calculateLuminance(color: Color): Double | Calculates the relative luminance of a color using the WCAG formula. Parameters - color: The color to calculate luminance for Returns - The relative luminance value between 0.0 and 1.0 |
eventMessageTextColor | fun eventMessageTextColor(conversationBackground: Color): Color | Text color for chat event lines — "an agent joined/left the chat", live-translation and language notices. Unlike a message, these render straight onto the conversation background (ColorBackground) rather than inside a bubble, so the color has to follow that surface. Parameters - conversationBackground: The resolved ColorBackground the event line is drawn on Returns - White on dark backgrounds, black on light ones |
generateSubtleShade | fun generateSubtleShade(baseColor: Color, amount: Float = 0.08f): Color | Generates a subtle shade of the given color. If the color is bright (light), returns a slightly darker shade. If the color is dark, returns a slightly lighter shade. Parameters - baseColor: The base color to generate a shade from - amount: The amount of adjustment (0.0 to 1.0), default 0.08 for subtle effect Returns - A slightly adjusted shade of the base color |
hasSufficientContrast | fun hasSufficientContrast(color1: Color, color2: Color, minimumRatio: Double = 4.5): Boolean | Checks if two colors have sufficient contrast for accessibility. Parameters - color1: First color - color2: Second color - minimumRatio: Minimum contrast ratio required (default: 4.5 for normal text) Returns - true if the contrast is sufficient, false otherwise |
isColorBright | fun isColorBright(color: Color): Boolean | Determines if a color is bright (light) or dark based on its luminance. Parameters - color: The color to check Returns - true if the color is bright (light), false if dark |
readableShadowColor | fun readableShadowColor(backgroundColor: Color): Color | Returns an appropriate shadow color based on background brightness. Parameters - backgroundColor: The background color to check against Returns - Black shadow for light backgrounds, white shadow for dark backgrounds |
readableTextColor | fun readableTextColor(backgroundColor: Color, lightColor: Color = Color.White, darkColor: Color = Color.Black): Color | Returns an appropriate contrast color (light or dark) based on background color. Similar to iOS UIColor.readableTextColor() Parameters - backgroundColor: The background color to check against - lightColor: Light color to use if background is dark (default: white) - darkColor: Dark color to use if background is light (default: black) Returns - Either lightColor or darkColor based on the background |
CustomKindlyTheme
data class
data class CustomKindlyTheme(val background: Color? = null, val botMessageBackground: Color? = null, val botMessageText: Color? = null, val bubbleButtonBackground: Color? = null, val buttonBackground: Color? = null, val buttonOutline: Color? = null, val buttonText: Color? = null, val chatBubbleText: Color? = null, val chatLogElements: Color? = null, val globalIconsButtonBackground: Color? = null, val headerBackground: Color? = null, val headerText: Color? = null, val inputBackground: Color? = null, val inputText: Color? = null, val panelBackground: Color? = null, val secondaryButtonBackground: Color? = null, val userMessageBackground: Color? = null, val userMessageText: Color? = null, val buttonSelectedBackground: Color? = null, val defaultShadow: Color? = null, val inputCursor: Color? = null, val maintenanceHeaderBackground: Color? = null) : KindlyThemeColorsDefault implementation of KindlyThemeColors with all colors set to null. When a color is null, the SDK will use the color from the server configuration or default color.
Member | Declaration | Description |
|---|---|---|
CustomKindlyTheme | constructor(background: Color? = null, botMessageBackground: Color? = null, botMessageText: Color? = null, bubbleButtonBackground: Color? = null, buttonBackground: Color? = null, buttonOutline: Color? = null, buttonText: Color? = null, chatBubbleText: Color? = null, chatLogElements: Color? = null, globalIconsButtonBackground: Color? = null, headerBackground: Color? = null, headerText: Color? = null, inputBackground: Color? = null, inputText: Color? = null, panelBackground: Color? = null, secondaryButtonBackground: Color? = null, userMessageBackground: Color? = null, userMessageText: Color? = null, buttonSelectedBackground: Color? = null, defaultShadow: Color? = null, inputCursor: Color? = null, maintenanceHeaderBackground: Color? = null) | |
background | open override val background: Color? | |
botMessageBackground | open override val botMessageBackground: Color? | |
botMessageText | open override val botMessageText: Color? | |
bubbleButtonBackground | open override val bubbleButtonBackground: Color? | |
buttonBackground | open override val buttonBackground: Color? | |
buttonOutline | open override val buttonOutline: Color? | |
buttonSelectedBackground | open override val buttonSelectedBackground: Color? | |
buttonText | open override val buttonText: Color? | |
chatBubbleText | open override val chatBubbleText: Color? | |
chatLogElements | open override val chatLogElements: Color? | |
defaultShadow | open override val defaultShadow: Color? | |
globalIconsButtonBackground | open override val globalIconsButtonBackground: Color? | |
headerBackground | open override val headerBackground: Color? | |
headerText | open override val headerText: Color? | |
inputBackground | open override val inputBackground: Color? | |
inputCursor | open override val inputCursor: Color? | |
inputText | open override val inputText: Color? | |
maintenanceHeaderBackground | open override val maintenanceHeaderBackground: Color? | |
panelBackground | open override val panelBackground: Color? | |
secondaryButtonBackground | open override val secondaryButtonBackground: Color? | |
userMessageBackground | open override val userMessageBackground: Color? | |
userMessageText | open override val userMessageText: Color? | |
IbmPlexSans
property
val IbmPlexSans: FontFamilyKindlyTheme
function
@Composable
fun KindlyTheme(content: @Composable () -> Unit)KindlyThemeColors
interface
interface KindlyThemeColorsInterface defining the customizable colors for the Kindly chat UI.
Member | Declaration | Description |
|---|---|---|
background | abstract val background: Color? | |
botMessageBackground | abstract val botMessageBackground: Color? | |
botMessageText | abstract val botMessageText: Color? | |
bubbleButtonBackground | abstract val bubbleButtonBackground: Color? | |
buttonBackground | abstract val buttonBackground: Color? | |
buttonOutline | abstract val buttonOutline: Color? | |
buttonSelectedBackground | abstract val buttonSelectedBackground: Color? | |
buttonText | abstract val buttonText: Color? | |
chatBubbleText | abstract val chatBubbleText: Color? | |
chatLogElements | abstract val chatLogElements: Color? | |
defaultShadow | abstract val defaultShadow: Color? | |
globalIconsButtonBackground | abstract val globalIconsButtonBackground: Color? | |
headerBackground | abstract val headerBackground: Color? | |
headerText | abstract val headerText: Color? | |
inputBackground | abstract val inputBackground: Color? | |
inputCursor | abstract val inputCursor: Color? | |
inputText | abstract val inputText: Color? | |
maintenanceHeaderBackground | abstract val maintenanceHeaderBackground: Color? | |
panelBackground | abstract val panelBackground: Color? | |
secondaryButtonBackground | abstract val secondaryButtonBackground: Color? | |
userMessageBackground | abstract val userMessageBackground: Color? | |
userMessageText | abstract val userMessageText: Color? | |
ThemeManager
object
object ThemeManagerManager class for handling theme customization in the Kindly SDK.
Member | Declaration | Description |
|---|---|---|
themeState | val themeState: StateFlow<Map<ItemColor, Color>> | |
clearUserTheme | fun clearUserTheme() | Clears the user-defined theme. |
hasAPITheme | fun hasAPITheme(): Boolean | Returns true if an API theme has been loaded from settings. |
hasUserTheme | fun hasUserTheme(): Boolean | Returns true if a user-defined theme has been set via setCustomTheme(). |
setUserTheme | fun setUserTheme(theme: KindlyThemeColors) | Sets a custom user-defined theme. Parameters - theme: The custom theme to be used. |
no.kindly.chatsdk.chat.presentation.webview
KindlyButtonClickEvent
data class
data class KindlyButtonClickEvent(val button: Map<String, Any?> = emptyMap(), val value: String = "", val type: String = "")Member | Declaration | Description |
|---|---|---|
KindlyButtonClickEvent | constructor(button: Map<String, Any?> = emptyMap(), value: String = "", type: String = "") | |
button | val button: Map<String, Any?> | |
type | val type: String | |
value | val value: String | |
KindlyDebugEvent
data class
data class KindlyDebugEvent(val type: String = "", val eventName: String? = null, val detail: Map<String, Any?> = emptyMap(), val kindlyInfo: Map<String, Any?> = emptyMap(), val stateChanged: Boolean = false, val previousState: Boolean? = null)Member | Declaration | Description |
|---|---|---|
KindlyDebugEvent | constructor(type: String = "", eventName: String? = null, detail: Map<String, Any?> = emptyMap(), kindlyInfo: Map<String, Any?> = emptyMap(), stateChanged: Boolean = false, previousState: Boolean? = null) | |
detail | val detail: Map<String, Any?> | |
eventName | val eventName: String? | |
kindlyInfo | val kindlyInfo: Map<String, Any?> | |
previousState | val previousState: Boolean? | |
stateChanged | val stateChanged: Boolean | |
type | val type: String | |
KindlyGlobalIconEvent
data class
data class KindlyGlobalIconEvent(val icon: Map<String, Any?> = emptyMap(), val action: String = "")Member | Declaration | Description |
|---|---|---|
KindlyGlobalIconEvent | constructor(icon: Map<String, Any?> = emptyMap(), action: String = "") | |
action | val action: String | |
icon | val icon: Map<String, Any?> | |
KindlyLoadEvent
data class
data class KindlyLoadEvent(val settings: Map<String, Any?> = emptyMap(), val language: String = "", val botKey: String = "")Member | Declaration | Description |
|---|---|---|
KindlyLoadEvent | constructor(settings: Map<String, Any?> = emptyMap(), language: String = "", botKey: String = "") | |
botKey | val botKey: String | |
language | val language: String | |
settings | val settings: Map<String, Any?> | |
KindlyMessageEvent
data class
data class KindlyMessageEvent(val message: Map<String, Any?> = emptyMap(), val chatLog: List<Map<String, Any?>> = emptyList())Member | Declaration | Description |
|---|---|---|
KindlyMessageEvent | constructor(message: Map<String, Any?> = emptyMap(), chatLog: List<Map<String, Any?>> = emptyList()) | |
chatLog | val chatLog: List<Map<String, Any?>> | |
message | val message: Map<String, Any?> | |
KindlyUIEvent
data class
data class KindlyUIEvent(val type: String = "", val source: String = "", val chatId: String = "", val value: Map<String, Any?> = emptyMap())Member | Declaration | Description |
|---|---|---|
KindlyUIEvent | constructor(type: String = "", source: String = "", chatId: String = "", value: Map<String, Any?> = emptyMap()) | |
chatId | val chatId: String | |
source | val source: String | |
type | val type: String | |
value | val value: Map<String, Any?> | |
KindlyWebEvent
data class
data class KindlyWebEvent(val type: String, val data: Map<String, Any?> = emptyMap())Event models for Kindly WebView JavaScript bridge Similar to iOS KindlyWebEventModel.swift
Member | Declaration | Description |
|---|---|---|
KindlyWebEvent | constructor(type: String, data: Map<String, Any?> = emptyMap()) | |
data | val data: Map<String, Any?> | |
type | val type: String | |
no.kindly.chatsdk.chat.presentation.welcomepage
WelcomePageBottomSheet
function
@Composable
fun WelcomePageBottomSheet(welcomePageData: WelcomePageDataSDK, languages: List<Pair<String, String>>, currentLanguageCode: String, onLanguageChange: (String) -> Unit, onDismiss: () -> Unit, onStartChat: () -> Unit)WelcomePageScreen
function
@Composable
fun WelcomePageScreen(welcomePageData: WelcomePageDataSDK, languages: List<Pair<String, String>>, currentLanguageCode: String, onLanguageChange: (String) -> Unit, onStartChat: () -> Unit, onClose: () -> Unit)