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(), messageContentFactory: MessageContentFactory = MessageContentFactory(), 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, downloadAttachmentUriGenerator: DownloadAttachmentUriGenerator = DefaultDownloadAttachmentUriGenerator, downloadRequestInterceptor: DownloadRequestInterceptor = DownloadRequestInterceptor { }, imageAssetTransformer: ImageAssetTransformer = DefaultImageAssetTransformer, messageAlignmentProvider: MessageAlignmentProvider = MessageAlignmentProvider.defaultMessageAlignmentProvider(), messageOptionsTheme: MessageOptionsTheme = MessageOptionsTheme.defaultTheme(), channelOptionsTheme: ChannelOptionsTheme = ChannelOptionsTheme.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), keyboardBehaviour: StreamKeyboardBehaviour = StreamKeyboardBehaviour.defaultBehaviour(), content: @Composable () -> Unit) Our theme that provides all the important properties for styling to the user.
Parameters
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.
Whether messages auto translation is enabled or not.
isComposerLinkPreviewEnabled
Whether the composer link preview is enabled or not.
Defines the appearance for ripples.
Attachment factories that we provide.
attachmentPreviewHandlers
Attachment preview handlers we provide.
quotedAttachmentFactories
Quoted attachment factories that we provide.
Used to create an icon Painter for the given reaction type.
messagePreviewIconFactory
Used to create a preview icon for the given message type.
Allow to simulate ui automation with given test tags.
DateFormatter Used throughout the app for date and time information.
A factory that creates new Coil ImageLoader instances.
downloadAttachmentUriGenerator
downloadRequestInterceptor
messageOptionsUserReactionAlignment
Alignment of the user reaction inside the message options.
attachmentsPickerTabFactories
Attachments picker tab factories that we provide.
Dictates whether video thumbnails will be displayed inside video previews.
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.
Theme of the current user messages.
Theme of the other users messages.
messageDateSeparatorTheme
Theme of the message date separator.
messageUnreadSeparatorTheme
Theme of the message unread separator.
Theme of the message composer.
Theme of the attachment picker.
Used for recording audio messages.
Configuration for different keyboard behaviours.
The content shown within the theme wrapper.