Skip to content

Commit 03a1679

Browse files
committed
Remove unused component themes
1 parent eeea27d commit 03a1679

9 files changed

Lines changed: 8 additions & 514 deletions

File tree

stream-chat-android-compose/api/stream-chat-android-compose.api

Lines changed: 4 additions & 116 deletions
Large diffs are not rendered by default.

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageItem.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ internal fun DefaultMessageDateSeparatorContent(dateSeparator: DateSeparatorItem
171171
Surface(
172172
modifier = Modifier
173173
.padding(vertical = 8.dp),
174-
color = ChatTheme.messageDateSeparatorTheme.backgroundColor,
174+
color = ChatTheme.colors.overlayBackgroundDark,
175175
shape = RoundedCornerShape(16.dp),
176176
) {
177177
Text(
178178
modifier = Modifier
179179
.padding(vertical = 2.dp, horizontal = 16.dp)
180180
.testTag("Stream_MessageDateSeparator"),
181181
text = ChatTheme.dateFormatter.formatRelativeDate(dateSeparator.date),
182-
style = ChatTheme.messageDateSeparatorTheme.textStyle,
182+
style = ChatTheme.typography.bodyDefault.copy(color = ChatTheme.colors.textOnDark),
183183
)
184184
}
185185
}
@@ -199,15 +199,15 @@ internal fun DefaultMessageUnreadSeparatorContent(unreadSeparatorItemState: Unre
199199
}
200200
.fillMaxWidth()
201201
.padding(bottom = 8.dp)
202-
.background(ChatTheme.messageUnreadSeparatorTheme.backgroundColor),
202+
.background(ChatTheme.colors.overlayBackgroundDark),
203203
contentAlignment = Alignment.Center,
204204
) {
205205
Text(
206206
modifier = Modifier.padding(vertical = 2.dp, horizontal = 16.dp),
207207
text = LocalContext.current.resources.getString(
208208
R.string.stream_compose_message_list_unread_separator,
209209
),
210-
style = ChatTheme.messageUnreadSeparatorTheme.textStyle,
210+
style = ChatTheme.typography.bodyDefault.copy(color = ChatTheme.colors.textOnDark),
211211
)
212212
}
213213
}

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/AttachmentPickerTheme.kt

Lines changed: 0 additions & 68 deletions
This file was deleted.

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatTheme.kt

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,9 @@ private val LocalReadCountEnabled = compositionLocalOf<Boolean> {
198198
"Make sure to wrap all usages of Stream components in a ChatTheme.",
199199
)
200200
}
201-
private val LocalMessageDateSeparatorTheme = compositionLocalOf<MessageDateSeparatorTheme> {
202-
error("No MessageDateSeparatorTheme provided! Make sure to wrap all usages of Stream components in a ChatTheme.")
203-
}
204-
private val LocalMessageUnreadSeparatorTheme = compositionLocalOf<MessageUnreadSeparatorTheme> {
205-
error("No MessageUnreadSeparatorTheme provided! Make sure to wrap all usages of Stream components in a ChatTheme.")
206-
}
207201
private val LocalMessageComposerTheme = compositionLocalOf<MessageComposerTheme> {
208202
error("No MessageComposerTheme provided! Make sure to wrap all usages of Stream components in a ChatTheme.")
209203
}
210-
private val LocalAttachmentPickerTheme = compositionLocalOf<AttachmentPickerTheme> {
211-
error("No AttachmentPickerTheme provided! Make sure to wrap all usages of Stream components in a ChatTheme.")
212-
}
213204
private val LocalAutoTranslationEnabled = compositionLocalOf<Boolean> {
214205
error(
215206
"No AutoTranslationEnabled Boolean provided! " +
@@ -289,10 +280,7 @@ private val LocalChatConfig = compositionLocalOf<ChatConfig> {
289280
* @param streamCdnImageResizing Sets the strategy for resizing images hosted on Stream's CDN. Disabled by default,
290281
* set [StreamCdnImageResizing.imageResizingEnabled] to true if you wish to enable resizing images. Note that resizing
291282
* applies only to images hosted on Stream's CDN which contain the original height (oh) and width (ow) query parameters.
292-
* @param messageDateSeparatorTheme Theme of the message date separator.
293-
* @param messageUnreadSeparatorTheme Theme of the message unread separator.
294283
* @param messageComposerTheme Theme of the message composer.
295-
* @param attachmentPickerTheme Theme of the attachment picker.
296284
* @param streamMediaRecorder Used for recording audio messages.
297285
* @param keyboardBehaviour Configuration for different keyboard behaviours.
298286
* @param mediaGalleryConfig Configuration for the media gallery screen.
@@ -349,21 +337,12 @@ public fun ChatTheme(
349337
videoThumbnailsEnabled: Boolean = true,
350338
streamCdnImageResizing: StreamCdnImageResizing = StreamCdnImageResizing.defaultStreamCdnImageResizing(),
351339
readCountEnabled: Boolean = true,
352-
messageDateSeparatorTheme: MessageDateSeparatorTheme = MessageDateSeparatorTheme.defaultTheme(
353-
typography = typography,
354-
colors = colors,
355-
),
356-
messageUnreadSeparatorTheme: MessageUnreadSeparatorTheme = MessageUnreadSeparatorTheme.defaultTheme(
357-
typography = typography,
358-
colors = colors,
359-
),
360340
messageComposerTheme: MessageComposerTheme = MessageComposerTheme.defaultTheme(
361341
isInDarkMode = isInDarkMode,
362342
typography = typography,
363343
shapes = shapes,
364344
colors = colors,
365345
),
366-
attachmentPickerTheme: AttachmentPickerTheme = AttachmentPickerTheme.defaultTheme(colors),
367346
messageTextFormatter: MessageTextFormatter = MessageTextFormatter.defaultFormatter(
368347
autoTranslationEnabled = autoTranslationEnabled,
369348
typography = typography,
@@ -404,10 +383,7 @@ public fun ChatTheme(
404383
LocalMessagePreviewFormatter provides messagePreviewFormatter,
405384
LocalMessageTextFormatter provides messageTextFormatter,
406385
LocalSearchResultNameFormatter provides searchResultNameFormatter,
407-
LocalMessageDateSeparatorTheme provides messageDateSeparatorTheme,
408-
LocalMessageUnreadSeparatorTheme provides messageUnreadSeparatorTheme,
409386
LocalMessageComposerTheme provides messageComposerTheme,
410-
LocalAttachmentPickerTheme provides attachmentPickerTheme,
411387
LocalStreamImageLoader provides imageLoaderFactory.imageLoader(LocalContext.current.applicationContext),
412388
LocalStreamImageHeadersProvider provides imageHeadersProvider,
413389
LocalStreamDownloadAttachmentUriGenerator provides downloadAttachmentUriGenerator,
@@ -666,22 +642,6 @@ public object ChatTheme {
666642
@ReadOnlyComposable
667643
get() = LocalReadCountEnabled.current
668644

669-
/**
670-
* Retrieves the current [MessageDateSeparatorTheme] at the call site's position in the hierarchy.
671-
*/
672-
public val messageDateSeparatorTheme: MessageDateSeparatorTheme
673-
@Composable
674-
@ReadOnlyComposable
675-
get() = LocalMessageDateSeparatorTheme.current
676-
677-
/**
678-
* Retrieves the current [MessageUnreadSeparatorTheme] at the call site's position in the hierarchy.
679-
*/
680-
public val messageUnreadSeparatorTheme: MessageUnreadSeparatorTheme
681-
@Composable
682-
@ReadOnlyComposable
683-
get() = LocalMessageUnreadSeparatorTheme.current
684-
685645
/**
686646
* Retrieves the current [MessageComposerTheme] at the call site's position in the hierarchy.
687647
*/
@@ -690,14 +650,6 @@ public object ChatTheme {
690650
@ReadOnlyComposable
691651
get() = LocalMessageComposerTheme.current
692652

693-
/**
694-
* Retrieves the current [AttachmentPickerTheme] at the call site's position in the hierarchy.
695-
*/
696-
public val attachmentPickerTheme: AttachmentPickerTheme
697-
@Composable
698-
@ReadOnlyComposable
699-
get() = LocalAttachmentPickerTheme.current
700-
701653
/**
702654
* Retrieves the current [ImageHeadersProvider] at the call site's position in the hierarchy.
703655
*/

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/MessageComposerTheme.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,16 @@ import androidx.compose.ui.text.TextStyle
2727
import androidx.compose.ui.text.style.TextDirection
2828
import androidx.compose.ui.unit.dp
2929
import io.getstream.chat.android.compose.R
30-
import io.getstream.chat.android.compose.ui.theme.messages.composer.attachments.AttachmentsPreviewTheme
3130
import io.getstream.chat.android.ui.common.feature.messages.composer.mention.Mention
3231

3332
/**
3433
* Represents the theming for the message composer.
3534
* @param inputField The theming for the input field in the message composer.
3635
* @param actionsTheme The theming for the different composer actions.
37-
* @param attachmentsPreview The theming for the attachments preview in the message composer.
3836
*/
3937
public data class MessageComposerTheme(
4038
val inputField: ComposerInputFieldTheme,
4139
val actionsTheme: ComposerActionsTheme,
42-
val attachmentsPreview: AttachmentsPreviewTheme,
4340
) {
4441

4542
public companion object {
@@ -62,7 +59,6 @@ public data class MessageComposerTheme(
6259
return MessageComposerTheme(
6360
inputField = ComposerInputFieldTheme.defaultTheme(typography, shapes, colors),
6461
actionsTheme = ComposerActionsTheme.defaultTheme(colors),
65-
attachmentsPreview = AttachmentsPreviewTheme.defaultTheme(isInDarkMode, typography, colors),
6662
)
6763
}
6864
}

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/MessageDateSeparatorTheme.kt

Lines changed: 0 additions & 60 deletions
This file was deleted.

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/MessageUnreadSeparatorTheme.kt

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)