ChatTheme

fun ChatTheme(isInDarkMode: Boolean = isSystemInDarkTheme(), autoTranslationEnabled: Boolean = false, isComposerLinkPreviewEnabled: Boolean = false, useDefaultSystemMediaPicker: Boolean = false, colors: StreamColors = if (isInDarkMode) StreamColors.defaultDarkColors() else StreamColors.defaultColors(), dimens: StreamDimens = StreamDimens.defaultDimens(), typography: StreamTypography = StreamTypography.defaultTypography(), shapes: StreamShapes = StreamShapes.defaultShapes(), rippleConfiguration: StreamRippleConfiguration = StreamRippleConfiguration.defaultRippleConfiguration( contentColor = LocalContentColor.current, lightTheme = !isInDarkMode, ), attachmentFactories: List<AttachmentFactory> = StreamAttachmentFactories.defaultFactories(), attachmentPreviewHandlers: List<AttachmentPreviewHandler> = AttachmentPreviewHandler.defaultAttachmentHandlers(LocalContext.current), quotedAttachmentFactories: List<AttachmentFactory> = StreamAttachmentFactories.defaultQuotedFactories(), reactionIconFactory: ReactionIconFactory = ReactionIconFactory.defaultFactory(), reactionOptionsTheme: ReactionOptionsTheme = ReactionOptionsTheme.defaultTheme(), messagePreviewIconFactory: MessagePreviewIconFactory = MessagePreviewIconFactory.defaultFactory(), pollSwitchItemFactory: PollSwitchItemFactory = DefaultPollSwitchItemFactory(context = LocalContext.current), allowUIAutomationTest: Boolean = false, dateFormatter: DateFormatter = DateFormatter.from(LocalContext.current), timeProvider: TimeProvider = TimeProvider.DEFAULT, 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(), imageHeadersProvider: ImageHeadersProvider = DefaultImageHeadersProvider, imageAssetTransformer: ImageAssetTransformer = DefaultImageAssetTransformer, messageAlignmentProvider: MessageAlignmentProvider = MessageAlignmentProvider.defaultMessageAlignmentProvider(), messageOptionsTheme: MessageOptionsTheme = MessageOptionsTheme.defaultTheme(), messageOptionsUserReactionAlignment: MessageOptionsUserReactionAlignment = MessageOptionsUserReactionAlignment.END, attachmentsPickerTabFactories: List<AttachmentsPickerTabFactory> = if (useDefaultSystemMediaPicker) { AttachmentsPickerTabFactories.defaultFactoriesWithoutStoragePermissions() } else { AttachmentsPickerTabFactories.defaultFactories() }, videoThumbnailsEnabled: Boolean = true, streamCdnImageResizing: StreamCdnImageResizing = StreamCdnImageResizing.defaultStreamCdnImageResizing(), readCountEnabled: Boolean = true, ownMessageTheme: MessageTheme = MessageTheme.defaultOwnTheme( isInDarkMode = isInDarkMode, typography = typography, shapes = shapes, colors = colors, ), otherMessageTheme: MessageTheme = MessageTheme.defaultOtherTheme( isInDarkMode = isInDarkMode, typography = typography, shapes = shapes, colors = colors, ), messageDateSeparatorTheme: MessageDateSeparatorTheme = MessageDateSeparatorTheme.defaultTheme( typography = typography, colors = colors, ), messageUnreadSeparatorTheme: MessageUnreadSeparatorTheme = MessageUnreadSeparatorTheme.defaultTheme( typography = typography, colors = colors, ), messageComposerTheme: MessageComposerTheme = MessageComposerTheme.defaultTheme( isInDarkMode = isInDarkMode, typography = typography, shapes = shapes, colors = colors, ), attachmentPickerTheme: AttachmentPickerTheme = AttachmentPickerTheme.defaultTheme(colors), messageTextFormatter: MessageTextFormatter = MessageTextFormatter.defaultFormatter( autoTranslationEnabled = autoTranslationEnabled, typography = typography, shapes = shapes, colors = colors, ownMessageTheme = ownMessageTheme, otherMessageTheme = otherMessageTheme, ), quotedMessageTextFormatter: QuotedMessageTextFormatter = QuotedMessageTextFormatter.defaultFormatter( autoTranslationEnabled = autoTranslationEnabled, context = LocalContext.current, typography = typography, shapes = shapes, 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.

rippleConfiguration

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.

reactionOptionsTheme

ReactionOptionsTheme Theme for the reaction option list in the selected message menu. For theming the message option list in the same menu, use messageOptionsTheme.

messagePreviewIconFactory

Used to create a preview icon for the given message type.

allowUIAutomationTest

Allow to simulate ui automation with given test tags.

dateFormatter

DateFormatter Used throughout the app for date and time information.

timeProvider

TimeProvider Used throughout the app for 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.

imageAssetTransformer

ImageAssetTransformer Used to transform image assets.

imageHeadersProvider

ImageHeadersProvider Used to provide headers for image requests.

messageAlignmentProvider

MessageAlignmentProvider Used to provide message alignment for the given message.

messageOptionsTheme

MessageOptionsTheme Theme for the message option list in the selected message menu. For theming the reaction option list in the same menu, use reactionOptionsTheme.

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.

attachmentPickerTheme

Theme of the attachment picker.

streamMediaRecorder

Used for recording audio messages.

content

The content shown within the theme wrapper.