ChatPanelTheme

class ChatPanelTheme @JvmOverloads constructor(    val colors: PanelColors = PanelColors(),     val incomingMessageStyle: MessageStyle = MessageStyle( backgroundColor = colors.background.toArgb(), backgroundContrastColor = colors.text.toArgb(), borderColor = colors.border.toArgb(), userNameColor = colors.primary.toArgb() ),     val outgoingMessageStyle: MessageStyle = MessageStyle( backgroundColor = colors.primary.toArgb(), backgroundContrastColor = colors.primaryContrast.toArgb(), borderColor = colors.primary.toArgb(), userNameColor = colors.primaryContrast.toArgb() ),     val icons: PanelIconography = PanelIconography(),     val shapes: Shapes = Shapes( small = RoundedCornerShape(4.dp), medium = RoundedCornerShape(4.dp), large = RoundedCornerShape(0.dp) ),     val avatarStyle: AvatarStyle = AvatarStyle( shape = shapes.small, backgroundColor = colors.background.copy(alpha = AlphaDefaults.TranslucentLightMode) .toSolidColor() ),     val avatarStackStyle: AvatarStackStyle = AvatarStackStyle(),     val typography: Typography = Typography())

Class that enclosing all theming properties of the Aircore Chat Panel.

Parameters

colors

Color palette to be applied to the panel

incomingMessageStyle

Style to be applied to all incoming messages

outgoingMessageStyle

Style to be applied to all outgoing messages

icons

Iconography to be applied to the panel

shapes

Shapes to be applied to the panel

avatarStyle

Style to be applied to all avatars

avatarStackStyle

Style to be applied to all avatar stacks

typography

Typography to be applied to the panel

Constructors

Link copied to clipboard
fun ChatPanelTheme(    context: Context,     icons: PanelIconography = PanelIconography( micDisabled = if (isLightMode(context)) io.aircore.panel.common.internal.R.drawable.common_ic_mic_off else io.aircore.panel.common.internal.R.drawable.common_ic_mic_off_dark ),     typography: Typography = Typography(),     shapes: Shapes = Shapes( small = RoundedCornerShape(4.dp), medium = RoundedCornerShape(4.dp), large = RoundedCornerShape(0.dp) ),     incomingMessageStyle: MessageStyle = with(context) { val colors = fromContext(this) MessageStyle( backgroundColor = colors.background.toArgb(), backgroundContrastColor = colors.text.toArgb(), borderColor = colors.border.toArgb(), userNameColor = colors.primary.toArgb() ) },     outgoingMessageStyle: MessageStyle = with(context) { val colors = fromContext(this) MessageStyle( backgroundColor = colors.primary.toArgb(), backgroundContrastColor = colors.primaryContrast.toArgb(), borderColor = colors.primary.toArgb(), userNameColor = colors.primaryContrast.toArgb() ) },     avatarStyle: AvatarStyle = AvatarStyle( shape = shapes.small, backgroundColor = fromContext(context).background.copy( alpha = if (isLightMode(context)) AlphaDefaults.TranslucentLightMode else AlphaDefaults.TranslucentDarkMode ).toSolidColor() ),     avatarStackStyle: AvatarStackStyle = AvatarStackStyle())

Creates a PanelsTheme using the app's theme colors.

Link copied to clipboard
fun ChatPanelTheme(    colors: PanelColors = PanelColors(),     incomingMessageStyle: MessageStyle = MessageStyle( backgroundColor = colors.background.toArgb(), backgroundContrastColor = colors.text.toArgb(), borderColor = colors.border.toArgb(), userNameColor = colors.primary.toArgb() ),     outgoingMessageStyle: MessageStyle = MessageStyle( backgroundColor = colors.primary.toArgb(), backgroundContrastColor = colors.primaryContrast.toArgb(), borderColor = colors.primary.toArgb(), userNameColor = colors.primaryContrast.toArgb() ),     icons: PanelIconography = PanelIconography(),     shapes: Shapes = Shapes( small = RoundedCornerShape(4.dp), medium = RoundedCornerShape(4.dp), large = RoundedCornerShape(0.dp) ),     avatarStyle: AvatarStyle = AvatarStyle( shape = shapes.small, backgroundColor = colors.background.copy(alpha = AlphaDefaults.TranslucentLightMode) .toSolidColor() ),     avatarStackStyle: AvatarStackStyle = AvatarStackStyle(),     typography: Typography = Typography())

Properties

Link copied to clipboard
val avatarStackStyle: AvatarStackStyle
Link copied to clipboard
val avatarStyle: AvatarStyle
Link copied to clipboard
val colors: PanelColors
Link copied to clipboard
val icons: PanelIconography
Link copied to clipboard
val incomingMessageStyle: MessageStyle
Link copied to clipboard
val outgoingMessageStyle: MessageStyle
Link copied to clipboard
val shapes: Shapes
Link copied to clipboard
val typography: Typography