Chat Panel Theme
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())
Content copied to clipboard
Class that enclosing all theming properties of the Aircore Chat Panel.
Parameters
colors
Color palette to be applied to the panel
incoming Message Style
Style to be applied to all incoming messages
outgoing Message Style
Style to be applied to all outgoing messages
icons
Iconography to be applied to the panel
shapes
Shapes to be applied to the panel
avatar Style
Style to be applied to all avatars
avatar Stack Style
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())
Content copied to clipboard
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())
Content copied to clipboard