presentation (2 of 3)
no.kindly.chatsdk.chat.presentation.components
KindlyDropdownMenu
function
@Composable
fun KindlyDropdownMenu(expanded: Boolean, onDismissRequest: () -> Unit, items: List<String>, onItemClick: (Int) -> Unit, backgroundColor: Color, itemColor: (Int) -> Color, itemTestTag: (Int) -> String = { "menu_item_$it" }, containerTestTag: String = "dropdown_topbar_menu")Anchored dropdown menu that scrolls when its content is taller than the available screen space. Built as a replacement for Material's DropdownMenu, which clamps its height and silently hides items that don't fit.
The popup right-aligns under its anchor (e.g. an overflow-icon button).
MainChatTopBar
function
@Composable
fun MainChatTopBar(title: String, avatarUrl: String?, onBackClick: () -> Unit, actions: @Composable RowScope.() -> Unit = {})Main chat style with avatar and title - for main conversation screen
SimpleTopBar
function
@Composable
fun SimpleTopBar(title: String, onBackClick: () -> Unit, actions: @Composable RowScope.() -> Unit = {})Simplified version with just back button and title - most common use case
SocketStatusIndicator
function
@Composable
fun SocketStatusIndicator(pusherState: ConnectionState?, modifier: Modifier = Modifier)StatusIndicator
function
@Composable
fun StatusIndicator(color: Color, isAnimated: Boolean = false, onTap: () -> Unit? = null, modifier: Modifier = Modifier)Generic status indicator component - displays a colored dot with optional pulsing animation Can be used for socket status, network status, API status, etc.
Parameters
- color: The color to display
- isAnimated: Whether to show pulsing animation (for "in progress" states)
- onTap: Optional click handler
- modifier: Modifier for customization
no.kindly.chatsdk.chat.presentation.feedback
FeedbackBottomSheet
function
@Composable
fun FeedbackBottomSheet(emojiSelectionData: EmojiSelectionData, predefinedButtonsData: PredefinedButtonsData, freeFormData: TextInputData, enablePredefinedButtonsStep: Boolean, enableFreeFormStep: Boolean, useSentimentButtons: Boolean, nextButtonTitle: String, backButtonTitle: String, submitButtonTitle: String, exitScreenText: String, onCancel: () -> Unit, onSubmit: (currentStep: FeedbackStep, emojiSelection: EmojiSelection?, buttonSelection: ButtonSelection?, textInput: String?) -> Unit)FeedbackBottomSheetWrapper
function
@Composable
fun FeedbackBottomSheetWrapper()FeedbackFormView
function
@Composable
fun FeedbackFormView(emojiSelectionData: EmojiSelectionData, predefinedButtonsData: PredefinedButtonsData, freeFormData: TextInputData, enablePredefinedButtonsStep: Boolean, enableFreeFormStep: Boolean, useSentimentButtons: Boolean, nextButtonTitle: String, backButtonTitle: String, submitButtonTitle: String, exitScreenText: String, onCancel: () -> Unit, onSubmit: (currentStep: FeedbackStep, emojiSelection: EmojiSelection?, buttonSelection: ButtonSelection?, textInput: String?) -> Unit)FeedbackStep
enum
enum FeedbackStep : Enum<FeedbackStep>Member | Declaration | Description |
|---|---|---|
EmojiSelection | EmojiSelection | |
ButtonSelection | ButtonSelection | |
TextInput | TextInput | |
entries | val entries: EnumEntries<FeedbackStep> | 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): FeedbackStep | 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<FeedbackStep> | 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. |
fireAPI
function
fun fireAPI(currentStep: FeedbackStep?)In iOS you do different requests based on the step Here you can replicate that logic
updateButtonsSelectionDataBasedOnSentiment
function
fun updateButtonsSelectionDataBasedOnSentiment(useSentimentButtons: Boolean, predefinedButtonsData: PredefinedButtonsData, sentiment: String): ButtonsSelectionData?Called to update the button selection data based on sentiment (similar to your iOS logic)
no.kindly.chatsdk.chat.presentation.feedback.helpers
ButtonData
data class
data class ButtonData(val id: String, val text: String)Member | Declaration | Description |
|---|---|---|
ButtonData | constructor(id: String, text: String) | |
id | val id: String | |
text | val text: String | |
FlowRowWithoutAccompanist
function
@Composable
fun FlowRowWithoutAccompanist(modifier: Modifier = Modifier, horizontalGap: Dp = 8.dp, verticalGap: Dp = 8.dp, content: @Composable () -> Unit)PredefinedButtonsData
data class
data class PredefinedButtonsData(val sentiments: Map<SentimentKey, SentimentData>)Member | Declaration | Description |
|---|---|---|
PredefinedButtonsData | constructor(sentiments: Map<SentimentKey, SentimentData>) | |
sentiments | val sentiments: Map<SentimentKey, SentimentData> | |
SentimentData
data class
data class SentimentData(val title: String, val buttons: List<ButtonData>)Member | Declaration | Description |
|---|---|---|
SentimentData | constructor(title: String, buttons: List<ButtonData>) | |
buttons | val buttons: List<ButtonData> | |
title | val title: String | |
no.kindly.chatsdk.chat.presentation.feedback.views
ButtonSelection
data class
data class ButtonSelection(val indices: List<Int>, val titles: List<String>)Member | Declaration | Description |
|---|---|---|
ButtonSelection | constructor(indices: List<Int>, titles: List<String>) | |
indices | val indices: List<Int> | |
titles | val titles: List<String> | |
ButtonsSelectionData
data class
data class ButtonsSelectionData(val title: String, val buttonTitles: List<String>)Member | Declaration | Description |
|---|---|---|
ButtonsSelectionData | constructor(title: String, buttonTitles: List<String>) | |
buttonTitles | val buttonTitles: List<String> | |
title | val title: String | |
ButtonsSelectionView
function
@Composable
fun ButtonsSelectionView(data: ButtonsSelectionData, maxSelection: Int? = null, onSelection: (ButtonSelection) -> Unit)EmojiImage
function
@Composable
fun EmojiImage(imageUrl: String, contentDescription: String, alpha: Float)EmojiItem
data class
data class EmojiItem(val imageUrl: String, val text: String, val sentiment: String, val showRating: Boolean)Member | Declaration | Description |
|---|---|---|
EmojiItem | constructor(imageUrl: String, text: String, sentiment: String, showRating: Boolean) | |
imageUrl | val imageUrl: String | |
sentiment | val sentiment: String | |
showRating | val showRating: Boolean | |
text | val text: String | |
EmojiSelection
data class
data class EmojiSelection(val text: String, val sentiment: String)Member | Declaration | Description |
|---|---|---|
EmojiSelection | constructor(text: String, sentiment: String) | |
sentiment | val sentiment: String | |
text | val text: String | |
EmojiSelectionData
data class
data class EmojiSelectionData(val title: String, val items: List<EmojiItem>, val ratingSystem: Int)Member | Declaration | Description |
|---|---|---|
EmojiSelectionData | constructor(title: String, items: List<EmojiItem>, ratingSystem: Int) | |
items | val items: List<EmojiItem> | |
ratingSystem | val ratingSystem: Int | |
title | val title: String | |
EmojiSelectionView
function
@Composable
fun EmojiSelectionView(data: EmojiSelectionData, selectedIndex: Int? = null, onSelection: (EmojiItem) -> Unit)FeedbackExitView
function
@Composable
fun FeedbackExitView(data: FeedbackExitViewInputData)FeedbackExitViewInputData
data class
data class FeedbackExitViewInputData(val title: String)Member | Declaration | Description |
|---|---|---|
FeedbackExitViewInputData | constructor(title: String) | |
title | val title: String | |
TextInputData
data class
data class TextInputData(val title: String)Member | Declaration | Description |
|---|---|---|
TextInputData | constructor(title: String) | |
title | val title: String | |
TextInputView
function
@Composable
fun TextInputView(data: TextInputData, onTextChanged: (String) -> Unit)no.kindly.chatsdk.chat.presentation.imagedetails
ImageDetailsScreen
function
@Composable
fun ImageDetailsScreen(url: String)no.kindly.chatsdk.chat.presentation.language
LanguageScreen
function
@Composable
fun LanguageScreen(onNavigate: () -> Unit)UI presentation of the LanguageScreen
LanguageUIState
sealed class
sealed class LanguageUIStateLanguage state for the LanguageScreen screen
LanguageUIState.DefaultState
object
object DefaultState : LanguageUIStateLanguageUIState.LanguagesCompleted
data class
data class LanguagesCompleted(val list: List<SettingLanguage>?) : LanguageUIStateMember | Declaration | Description |
|---|---|---|
LanguagesCompleted | constructor(list: List<SettingLanguage>?) | |
list | val list: List<SettingLanguage>? | |
no.kindly.chatsdk.chat.presentation.mainscreen
MainScreenUIState
sealed class
sealed class MainScreenUIStateMainScreenUIState contains the states of the MainScreen
MainScreenUIState.ErrorState
object
object ErrorState : MainScreenUIStateMainScreenUIState.LoadingState
object
object LoadingState : MainScreenUIStateMainScreenUIState.ShowConversationState
data class
data class ShowConversationState(val codeLanguage: String? = "en", val title: String?, val botAvatarUrl: String? = null) : MainScreenUIStateMember | Declaration | Description |
|---|---|---|
ShowConversationState | constructor(codeLanguage: String? = "en", title: String?, botAvatarUrl: String? = null) | |
botAvatarUrl | val botAvatarUrl: String? | |
codeLanguage | val codeLanguage: String? | |
title | val title: String? | |
MaintenanceHeaderView
function
@Composable
fun MaintenanceHeaderView(modifier: Modifier = Modifier)• This is a composable function that displays the header view for maintenance items. • It includes a clickable text that opens a URL specified in the language configuration. • • @param modifier The modifier to be applied to the header view.
SnackBarComponent
function
@Composable
fun SnackBarComponent(errorMesag: String, isVisible: MutableState<Boolean>)no.kindly.chatsdk.chat.presentation.navigation
MainNavigationCoordinator
object
object MainNavigationCoordinatorAndroid equivalent of iOS MainCoordinator Centralized navigation management following iOS pattern
Member | Declaration | Description |
|---|---|---|
currentViewController | val currentViewController: String? | |
navController | val navController: NavHostController? | |
canPopBack | fun canPopBack(): Boolean | Check if we can go back |
getPreviousDestination | fun getPreviousDestination(): String? | Get the previous destination in the stack |
initialize | fun initialize(navController: NavHostController) | |
isAtRoot | fun isAtRoot(): Boolean | Check if we're at the root (main conversation screen) |
isCurrentRoute | fun isCurrentRoute(route: String): Boolean | Check if current route matches given route |
popCurrentViewController | fun popCurrentViewController(animated: Boolean = true): Boolean | Pop current screen (equivalent to iOS popViewController) |
popToRootViewController | fun popToRootViewController(animated: Boolean = true) | Pop to root screen (equivalent to iOS popToRootViewController) |
present | fun present(route: String, fullScreen: Boolean = false, animated: Boolean = true) | Present a screen modally (for future modal implementations) |
pushDownloadPreviewViewController | fun pushDownloadPreviewViewController(url: String, format: Format, animated: Boolean = true) | Navigate to Download Preview screen |
pushImageDetailsViewController | fun pushImageDetailsViewController(imageUrl: String, animated: Boolean = true) | Navigate to Image Details screen |
pushLanguageViewController | fun pushLanguageViewController(animated: Boolean = true) | Navigate to Language selection screen |
pushSettingsViewController | fun pushSettingsViewController(animated: Boolean = true) | Navigate to Settings screen |
pushViewController | fun pushViewController(route: String, animated: Boolean = true, removePreviousVCs: Boolean = false) | Push a new screen onto the navigation stack (equivalent to iOS pushViewController) |
NameScreen
enum
enum NameScreen : Enum<NameScreen>Member | Declaration | Description |
|---|---|---|
MainScreen | MainScreen | |
Settings | Settings | |
ImageDetails | ImageDetails | |
Language | Language | |
WebView | WebView | |
DownloadPreview | DownloadPreview | |
FeedbackForm | FeedbackForm | |
entries | val entries: EnumEntries<NameScreen> | 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): NameScreen | 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<NameScreen> | 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. |
NavigationItem
sealed class
sealed class NavigationItemMember | Declaration | Description |
|---|---|---|
route | val route: String | |
NavigationItem.Conversation
object
object Conversation : NavigationItemNavigationItem.DownloadPreview
object
object DownloadPreview : NavigationItemMember | Declaration | Description |
|---|---|---|
createRoute | fun createRoute(url: String, format: String): String | |
NavigationItem.FeedbackForm
object
object FeedbackForm : NavigationItemMember | Declaration | Description |
|---|---|---|
createRoute | fun createRoute(triggerTypeString: String): String | |
NavigationItem.ImageDetails
object
object ImageDetails : NavigationItemMember | Declaration | Description |
|---|---|---|
createRoute | fun createRoute(imageUrl: String): String | |
NavigationItem.LanguageScreen
object
object LanguageScreen : NavigationItemNavigationItem.SettingsScreen
object
object SettingsScreen : NavigationItemNavigationItem.WebViewScreen
object
object WebViewScreen : NavigationItemno.kindly.chatsdk.chat.presentation.settings
SettingsScreen
function
@Composable
fun SettingsScreen(onNavigate: (ScreenType) -> Unit)SettingsUiState
sealed class
sealed class SettingsUiStateSettings state for the settings screen
SettingsUiState.CompleteStartOverState
object
object CompleteStartOverState : SettingsUiStateSettingsUiState.DefaultState
object
object DefaultState : SettingsUiStateSettingsUiState.DeleteChatLogState
object
object DeleteChatLogState : SettingsUiStateSettingsUiState.ErrorConnectionState
object
object ErrorConnectionState : SettingsUiStateSettingsUiState.LoadingStartOverState
object
object LoadingStartOverState : SettingsUiStateSettingsUiState.ServerErrorState
data class
data class ServerErrorState(val errorString: String) : SettingsUiStateMember | Declaration | Description |
|---|---|---|
ServerErrorState | constructor(errorString: String) | |
errorString | val errorString: String | |
no.kindly.chatsdk.chat.presentation.statusbar
ConnectionErrorView
class
class ConnectionErrorView : StatusBarProtocolMember | Declaration | Description |
|---|---|---|
ConnectionErrorView | constructor() | |
identifier | open override val identifier: String | |
isVisible | open override var isVisible: Boolean | |
priority | open override val priority: Int | |
Content | @Composable open override fun Content(modifier: Modifier) | |
HandoverStateView
class
class HandoverStateView(handoverState: HandoverState, agentName: String? = null, queuePosition: Int? = null, waitTime: Int? = null, onLeaveHandoverClicked: () -> Unit) : StatusBarProtocolMember | Declaration | Description |
|---|---|---|
HandoverStateView | constructor(handoverState: HandoverState, agentName: String? = null, queuePosition: Int? = null, waitTime: Int? = null, onLeaveHandoverClicked: () -> Unit) | |
identifier | open override val identifier: String | |
isVisible | open override var isVisible: Boolean | |
priority | open override val priority: Int | |
Content | @Composable open override fun Content(modifier: Modifier) | |
MaintenanceModeView
class
class MaintenanceModeView : StatusBarProtocolMember | Declaration | Description |
|---|---|---|
MaintenanceModeView | constructor() | |
identifier | open override val identifier: String | |
isVisible | open override var isVisible: Boolean | |
priority | open override val priority: Int | |
Content | @Composable open override fun Content(modifier: Modifier) | |
NoInternetView
class
class NoInternetView : StatusBarProtocolMember | Declaration | Description |
|---|---|---|
NoInternetView | constructor() | |
identifier | open override val identifier: String | |
isVisible | open override var isVisible: Boolean | |
priority | open override val priority: Int | |
Content | @Composable open override fun Content(modifier: Modifier) | |
rememberStatusBarManager
function
@Composable
fun rememberStatusBarManager(): StatusBarManager