Package-level declarations

Types

Link copied to clipboard
object ChatTheme

Contains ease-of-use accessors for different properties used to style and customize the app look and feel.

Link copied to clipboard
data class ComponentSize(val width: Dp, val height: Dp)

Represents the size of a component.

Link copied to clipboard
data class ComposerCancelIconStyle(val backgroundShape: Shape, val backgroundColor: Color, val painter: Painter, val tint: Color)

Represents the theming for the cancel icon used in the message composer.

Link copied to clipboard
data class ComposerInputFieldTheme(val borderShape: Shape, val backgroundColor: Color, val textStyle: TextStyle, val cursorBrushColor: Color)

Represents the theming for the input field in the message composer.

Link copied to clipboard
data class ComposerLinkPreviewTheme(val imageSize: ComponentSize, val imageShape: Shape, val imagePadding: Dp, val separatorSize: ComponentSize, val separatorMarginStart: Dp, val separatorMarginEnd: Dp, val title: TextComponentStyle, val titleToSubtitle: Dp, val subtitle: TextComponentStyle, val cancelIcon: ComposerCancelIconStyle)

Represents the theming for the link preview in the message composer.

Link copied to clipboard
data class MessageComposerTheme(val attachmentCancelIcon: ComposerCancelIconStyle, val linkPreview: ComposerLinkPreviewTheme, val inputField: ComposerInputFieldTheme)

Represents the theming for the message composer.

Link copied to clipboard
data class MessageDateSeparatorTheme(val textStyle: TextStyle, val backgroundColor: Color)

Represents message date separator theming.

Link copied to clipboard
data class MessageTheme(val textStyle: TextStyle, val backgroundColor: Color, val quotedTextStyle: TextStyle, val quotedBackgroundColor: Color, val deletedBackgroundColor: Color)

Represents message theming.

Link copied to clipboard
data class MessageUnreadSeparatorTheme(val textStyle: TextStyle, val backgroundColor: Color)

Represents message unread separator theming.

Link copied to clipboard
data class StreamColors(val textHighEmphasis: Color, val textHighEmphasisInverse: Color, val textLowEmphasis: Color, val disabled: Color, val borders: Color, val inputBackground: Color, val appBackground: Color, val barsBackground: Color, val linkBackground: Color, val overlay: Color, val overlayDark: Color, val primaryAccent: Color, val errorAccent: Color, val infoAccent: Color, val highlight: Color, val ownMessagesBackground: Color, val otherMessagesBackground: Color, val deletedMessagesBackground: Color, val giphyMessageBackground: Color, val threadSeparatorGradientStart: Color, val threadSeparatorGradientEnd: Color, val ownMessageText: Color = textHighEmphasis, val otherMessageText: Color = textHighEmphasis, val imageBackgroundMessageList: Color, val imageBackgroundMediaGalleryPicker: Color, val videoBackgroundMessageList: Color, val videoBackgroundMediaGalleryPicker: Color, val showMoreOverlay: Color, val showMoreCountText: Color, val ownMessageQuotedBackground: Color = otherMessagesBackground, val otherMessageQuotedBackground: Color = ownMessagesBackground, val ownMessageQuotedText: Color = textHighEmphasis, val otherMessageQuotedText: Color = textHighEmphasis)

Contains all the colors in our palette. Each color is used for various things an can be changed to customize the app design style.

Link copied to clipboard
data class StreamDimens(val channelItemVerticalPadding: Dp, val channelItemHorizontalPadding: Dp, val channelAvatarSize: Dp, val selectedChannelMenuUserItemWidth: Dp, val selectedChannelMenuUserItemHorizontalPadding: Dp, val selectedChannelMenuUserItemAvatarSize: Dp, val attachmentsContentImageWidth: Dp, val attachmentsContentGiphyWidth: Dp, val attachmentsContentGiphyHeight: Dp, val attachmentsContentLinkWidth: Dp, val attachmentsContentFileWidth: Dp, val attachmentsContentFileUploadWidth: Dp, val attachmentsContentUnsupportedWidth: Dp, val threadSeparatorVerticalPadding: Dp, val threadSeparatorTextVerticalPadding: Dp, val messageOptionsItemHeight: Dp, val suggestionListMaxHeight: Dp, val suggestionListPadding: Dp, val suggestionListElevation: Dp, val mentionSuggestionItemHorizontalPadding: Dp, val mentionSuggestionItemVerticalPadding: Dp, val mentionSuggestionItemAvatarSize: Dp, val commandSuggestionItemHorizontalPadding: Dp, val commandSuggestionItemVerticalPadding: Dp, val commandSuggestionItemIconSize: Dp, val threadParticipantItemSize: Dp, val userReactionsMaxHeight: Dp, val userReactionItemWidth: Dp, val userReactionItemAvatarSize: Dp, val userReactionItemIconSize: Dp, val reactionOptionItemIconSize: Dp, val headerElevation: Dp, val messageItemMaxWidth: Dp, val quotedMessageTextVerticalPadding: Dp, val quotedMessageTextHorizontalPadding: Dp, val quotedMessageAttachmentPreviewSize: Dp, val quotedMessageAttachmentTopPadding: Dp, val quotedMessageAttachmentBottomPadding: Dp, val quotedMessageAttachmentStartPadding: Dp, val quotedMessageAttachmentEndPadding: Dp, val groupAvatarInitialsXOffset: Dp, val groupAvatarInitialsYOffset: Dp, val attachmentsContentImageMaxHeight: Dp, val attachmentsContentGiphyMaxWidth: Dp = attachmentsContentGiphyWidth, val attachmentsContentGiphyMaxHeight: Dp = attachmentsContentGiphyHeight, val attachmentsContentVideoMaxHeight: Dp, val attachmentsContentMediaGridSpacing: Dp, val attachmentsContentVideoWidth: Dp, val attachmentsContentGroupPreviewWidth: Dp, val attachmentsContentGroupPreviewHeight: Dp)

Contains all the dimens we provide for our components.

Link copied to clipboard
data class StreamShapes(val avatar: Shape, val myMessageBubble: Shape, val otherMessageBubble: Shape, val inputField: Shape, val attachment: Shape, val imageThumbnail: Shape, val bottomSheet: Shape, val suggestionList: Shape, val attachmentSiteLabel: Shape, val header: Shape, val quotedAttachment: Shape)

Contains all the shapes we provide for our components.

Link copied to clipboard
data class StreamTypography(val title1: TextStyle, val title3: TextStyle, val title3Bold: TextStyle, val body: TextStyle, val bodyItalic: TextStyle, val bodyBold: TextStyle, val footnote: TextStyle, val footnoteItalic: TextStyle, val footnoteBold: TextStyle, val captionBold: TextStyle, val tabBar: TextStyle, val singleEmoji: TextStyle, val emojiOnly: TextStyle)

Contains all the typography we provide for our components.

Link copied to clipboard
data class TextComponentStyle(val color: Color, val style: TextStyle, val maxLines: Int = Int.MAX_VALUE, val overflow: TextOverflow = TextOverflow.Clip)

Represents the styling for the text component.

Functions

Link copied to clipboard
fun ChatTheme(isInDarkMode: Boolean = isSystemInDarkTheme(), autoTranslationEnabled: Boolean = false, isComposerLinkPreviewEnabled: Boolean = false, colors: StreamColors = if (isInDarkMode) StreamColors.defaultDarkColors() else StreamColors.defaultColors(), dimens: StreamDimens = StreamDimens.defaultDimens(), typography: StreamTypography = StreamTypography.defaultTypography(), shapes: StreamShapes = StreamShapes.defaultShapes(), rippleTheme: RippleTheme = StreamRippleTheme, attachmentFactories: List<AttachmentFactory> = StreamAttachmentFactories.defaultFactories(), attachmentPreviewHandlers: List<AttachmentPreviewHandler> = AttachmentPreviewHandler.defaultAttachmentHandlers(LocalContext.current), quotedAttachmentFactories: List<AttachmentFactory> = StreamAttachmentFactories.defaultQuotedFactories(), reactionIconFactory: ReactionIconFactory = ReactionIconFactory.defaultFactory(), allowUIAutomationTest: Boolean = false, dateFormatter: DateFormatter = DateFormatter.from(LocalContext.current), channelNameFormatter: ChannelNameFormatter = ChannelNameFormatter.defaultFormatter(LocalContext.current), messagePreviewFormatter: MessagePreviewFormatter = MessagePreviewFormatter.defaultFormatter( context = LocalContext.current, typography = typography, attachmentFactories = attachmentFactories, autoTranslationEnabled = autoTranslationEnabled, ), searchResultNameFormatter: SearchResultNameFormatter = SearchResultNameFormatter.defaultFormatter(), imageLoaderFactory: StreamCoilImageLoaderFactory = StreamCoilImageLoaderFactory.defaultFactory(), messageAlignmentProvider: MessageAlignmentProvider = MessageAlignmentProvider.defaultMessageAlignmentProvider(), messageOptionsUserReactionAlignment: MessageOptionsUserReactionAlignment = MessageOptionsUserReactionAlignment.END, attachmentsPickerTabFactories: List<AttachmentsPickerTabFactory> = AttachmentsPickerTabFactories.defaultFactories(), videoThumbnailsEnabled: Boolean = true, streamCdnImageResizing: StreamCdnImageResizing = StreamCdnImageResizing.defaultStreamCdnImageResizing(), readCountEnabled: Boolean = true, ownMessageTheme: MessageTheme = MessageTheme.defaultOwnTheme( typography = typography, colors = colors, ), otherMessageTheme: MessageTheme = MessageTheme.defaultOtherTheme( typography = typography, colors = colors, ), messageDateSeparatorTheme: MessageDateSeparatorTheme = MessageDateSeparatorTheme.defaultTheme( typography = typography, colors = colors, ), messageUnreadSeparatorTheme: MessageUnreadSeparatorTheme = MessageUnreadSeparatorTheme.defaultTheme( typography = typography, colors = colors, ), messageComposerTheme: MessageComposerTheme = MessageComposerTheme.defaultTheme( typography = typography, shapes = shapes, colors = colors, ), messageTextFormatter: MessageTextFormatter = MessageTextFormatter.defaultFormatter( autoTranslationEnabled = autoTranslationEnabled, typography = typography, colors = colors, ownMessageTheme = ownMessageTheme, otherMessageTheme = otherMessageTheme, ), quotedMessageTextFormatter: QuotedMessageTextFormatter = QuotedMessageTextFormatter.defaultFormatter( autoTranslationEnabled = autoTranslationEnabled, context = LocalContext.current, typography = typography, colors = colors, ownMessageTheme = ownMessageTheme, otherMessageTheme = otherMessageTheme, ), streamMediaRecorder: StreamMediaRecorder = DefaultStreamMediaRecorder(LocalContext.current), content: @Composable () -> Unit)

Our theme that provides all the important properties for styling to the user.