ChatTheme

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.

Parameters

isInDarkMode

If we're currently in the dark mode or not. Affects only the default color palette that's provided. If you customize colors, make sure to add your own logic for dark/light colors.

autoTranslationEnabled

Whether messages auto translation is enabled or not.

isComposerLinkPreviewEnabled

Whether the composer link preview is enabled or not.

colors

The set of colors we provide, wrapped in StreamColors.

dimens

The set of dimens we provide, wrapped in StreamDimens.

typography

The set of typography styles we provide, wrapped in StreamTypography.

shapes

The set of shapes we provide, wrapped in StreamShapes.

rippleTheme

Defines the appearance for ripples.

attachmentFactories

Attachment factories that we provide.

attachmentPreviewHandlers

Attachment preview handlers we provide.

quotedAttachmentFactories

Quoted attachment factories that we provide.

reactionIconFactory

Used to create an icon Painter for the given reaction type.

allowUIAutomationTest

Allow to simulate ui automation with given test tags.

dateFormatter

DateFormatter used throughout the app for date and time information.

channelNameFormatter

ChannelNameFormatter used throughout the app for channel names.

messagePreviewFormatter

MessagePreviewFormatter used to generate a string preview for the given message.

imageLoaderFactory

A factory that creates new Coil ImageLoader instances.

messageAlignmentProvider

MessageAlignmentProvider used to provide message alignment for the given message.

messageOptionsUserReactionAlignment

Alignment of the user reaction inside the message options.

attachmentsPickerTabFactories

Attachments picker tab factories that we provide.

videoThumbnailsEnabled

Dictates whether video thumbnails will be displayed inside video previews.

streamCdnImageResizing

Sets the strategy for resizing images hosted on Stream's CDN. Disabled by default, set StreamCdnImageResizing.imageResizingEnabled to true if you wish to enable resizing images. Note that resizing applies only to images hosted on Stream's CDN which contain the original height (oh) and width (ow) query parameters.

ownMessageTheme

Theme of the current user messages.

otherMessageTheme

Theme of the other users messages.

messageDateSeparatorTheme

Theme of the message date separator.

messageUnreadSeparatorTheme

Theme of the message unread separator.

messageComposerTheme

Theme of the message composer.

streamMediaRecorder

Used for recording audio messages.

content

The content shown within the theme wrapper.