Skip to content

Commit 045959e

Browse files
committed
Replace StreamDimens with StreamDesign.Dimens across the library and samples
1 parent fac07cd commit 045959e

8 files changed

Lines changed: 22 additions & 56 deletions

File tree

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3871,7 +3871,6 @@ public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Dimen
38713871

38723872
public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Dimens$Companion {
38733873
public final fun default ()Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Dimens;
3874-
public final fun defaultDimens ()Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Dimens;
38753874
}
38763875

38773876
public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Typography {

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/StreamAttachmentFactories.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import io.getstream.chat.android.compose.ui.attachments.factory.UnsupportedAttac
3838
import io.getstream.chat.android.compose.ui.attachments.factory.UploadAttachmentFactory
3939
import io.getstream.chat.android.compose.ui.attachments.preview.MediaGalleryPreviewContract
4040
import io.getstream.chat.android.compose.ui.attachments.preview.handler.AttachmentPreviewHandler
41-
import io.getstream.chat.android.compose.ui.theme.StreamDimens
41+
import io.getstream.chat.android.compose.ui.theme.StreamDesign
4242
import io.getstream.chat.android.compose.viewmodel.messages.AudioPlayerViewModelFactory
4343
import io.getstream.chat.android.models.Attachment
4444
import io.getstream.chat.android.models.Message
@@ -68,9 +68,9 @@ public object StreamAttachmentFactories {
6868
* Giphy attachments.
6969
* @param giphySizingMode Sets the Giphy container sizing strategy. Setting it to automatic
7070
* makes the container capable of adaptive resizing and ignore
71-
* [StreamDimens.attachmentsContentGiphyWidth] and [StreamDimens.attachmentsContentGiphyHeight]
71+
* [StreamDesign.Dimens.attachmentsContentGiphyWidth] and [StreamDesign.Dimens.attachmentsContentGiphyHeight]
7272
* dimensions, however you can still clip maximum dimensions using
73-
* [StreamDimens.attachmentsContentGiphyMaxWidth] and [StreamDimens.attachmentsContentGiphyMaxHeight].
73+
* [StreamDesign.Dimens.attachmentsContentGiphyMaxWidth] and [StreamDesign.Dimens.attachmentsContentGiphyMaxHeight].
7474
* Setting it to fixed size mode will make it respect all given dimensions.
7575
* @param contentScale Used to determine the way Giphys are scaled inside the [Image] composable.
7676
* @param skipEnrichUrl Used by the media gallery. If set to true will skip enriching URLs when you update the

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/content/GiphyAttachmentContent.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import io.getstream.chat.android.compose.R
5757
import io.getstream.chat.android.compose.state.messages.attachments.AttachmentState
5858
import io.getstream.chat.android.compose.ui.theme.ChatTheme
5959
import io.getstream.chat.android.compose.ui.theme.MessageStyling
60-
import io.getstream.chat.android.compose.ui.theme.StreamDimens
60+
import io.getstream.chat.android.compose.ui.theme.StreamDesign
6161
import io.getstream.chat.android.compose.ui.theme.StreamTokens
6262
import io.getstream.chat.android.compose.ui.util.AsyncImagePreviewHandler
6363
import io.getstream.chat.android.compose.ui.util.StreamAsyncImage
@@ -82,9 +82,9 @@ import io.getstream.chat.android.ui.common.utils.giphyInfo
8282
* Giphy attachments.
8383
* @param giphySizingMode Sets the Giphy container sizing strategy. Setting it to automatic
8484
* makes the container capable of adaptive resizing and ignore
85-
* [StreamDimens.attachmentsContentGiphyWidth] and [StreamDimens.attachmentsContentGiphyHeight]
86-
* dimensions, however you can still clip maximum dimensions using [StreamDimens.attachmentsContentGiphyMaxWidth]
87-
* and [StreamDimens.attachmentsContentGiphyMaxHeight].
85+
* [StreamDesign.Dimens.attachmentsContentGiphyWidth] and [StreamDesign.Dimens.attachmentsContentGiphyHeight]
86+
* dimensions, however you can still clip maximum dimensions using [StreamDesign.Dimens.attachmentsContentGiphyMaxWidth]
87+
* and [StreamDesign.Dimens.attachmentsContentGiphyMaxHeight].
8888
* Setting it to fixed size mode will make it respect all given dimensions.
8989
* @param contentScale Used to determine the way Giphys are scaled inside the [Image] composable.
9090
* @param onItemClick Lambda called when an item gets clicked.
@@ -141,9 +141,9 @@ public fun GiphyAttachmentContent(
141141
* Giphy attachments.
142142
* @param giphySizingMode Sets the Giphy container sizing strategy. Setting it to automatic
143143
* makes the container capable of adaptive resizing and ignore
144-
* [StreamDimens.attachmentsContentGiphyWidth] and [StreamDimens.attachmentsContentGiphyHeight]
145-
* dimensions, however you can still clip maximum dimensions using [StreamDimens.attachmentsContentGiphyMaxWidth]
146-
* and [StreamDimens.attachmentsContentGiphyMaxHeight].
144+
* [StreamDesign.Dimens.attachmentsContentGiphyWidth] and [StreamDesign.Dimens.attachmentsContentGiphyHeight]
145+
* dimensions, however you can still clip maximum dimensions using [StreamDesign.Dimens.attachmentsContentGiphyMaxWidth]
146+
* and [StreamDesign.Dimens.attachmentsContentGiphyMaxHeight].
147147
* Setting it to fixed size mode will make it respect all given dimensions.
148148
* @param contentScale Used to determine the way Giphys are scaled inside the [Image] composable.
149149
* @param onItemClick Lambda called when an item gets clicked.

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/factory/GiphyAttachmentFactory.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import io.getstream.chat.android.compose.ui.attachments.AttachmentFactory
2424
import io.getstream.chat.android.compose.ui.attachments.content.GiphyAttachmentClickData
2525
import io.getstream.chat.android.compose.ui.attachments.content.GiphyAttachmentContent
2626
import io.getstream.chat.android.compose.ui.attachments.content.onGiphyAttachmentContentClick
27-
import io.getstream.chat.android.compose.ui.theme.StreamDimens
27+
import io.getstream.chat.android.compose.ui.theme.StreamDesign
2828
import io.getstream.chat.android.models.Attachment
2929
import io.getstream.chat.android.ui.common.utils.GiphyInfoType
3030
import io.getstream.chat.android.ui.common.utils.GiphySizingMode
@@ -38,9 +38,9 @@ import io.getstream.chat.android.ui.common.utils.GiphySizingMode
3838
* Giphy attachments.
3939
* @param giphySizingMode Sets the Giphy container sizing strategy. Setting it to automatic
4040
* makes the container capable of adaptive resizing and ignore
41-
* [StreamDimens.attachmentsContentGiphyWidth] and [StreamDimens.attachmentsContentGiphyHeight]
42-
* dimensions, however you can still clip maximum dimensions using [StreamDimens.attachmentsContentGiphyMaxWidth]
43-
* and [StreamDimens.attachmentsContentGiphyMaxHeight].
41+
* [StreamDesign.Dimens.attachmentsContentGiphyWidth] and [StreamDesign.Dimens.attachmentsContentGiphyHeight]
42+
* dimensions, however you can still clip maximum dimensions using [StreamDesign.Dimens.attachmentsContentGiphyMaxWidth]
43+
* and [StreamDesign.Dimens.attachmentsContentGiphyMaxHeight].
4444
* Setting it to fixed size mode will make it respect all given dimensions.
4545
* @param contentScale Used to determine the way Giphys are scaled inside the [Image] composable.
4646
* @param onContentItemClick Lambda called when an item gets clicked.

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ import io.getstream.sdk.chat.audio.recording.StreamMediaRecorder
7878
private val LocalColors = compositionLocalOf<StreamDesign.Colors> {
7979
error("No colors provided! Make sure to wrap all usages of Stream components in a ChatTheme.")
8080
}
81-
private val LocalDimens = compositionLocalOf<StreamDimens> {
81+
private val LocalDimens = compositionLocalOf<StreamDesign.Dimens> {
8282
error("No dimens provided! Make sure to wrap all usages of Stream components in a ChatTheme.")
8383
}
8484
private val LocalTypography = compositionLocalOf<StreamDesign.Typography> {
@@ -245,7 +245,7 @@ private val LocalChatConfig = compositionLocalOf<ChatConfig> {
245245
* @param attachmentPickerConfig Configuration for the attachment picker modes and settings.
246246
* @param messageComposerFloatingStyleEnabled Whether the message composer should use the floating style or not.
247247
* @param colors The set of colors we provide, wrapped in [StreamDesign.Colors].
248-
* @param dimens The set of dimens we provide, wrapped in [StreamDimens].
248+
* @param dimens The set of dimens we provide, wrapped in [StreamDesign.Dimens].
249249
* @param typography The set of typography styles we provide, wrapped in [StreamDesign.Typography].
250250
* @param rippleConfiguration Defines the appearance for ripples.
251251
* @param userPresence The user presence display configuration.
@@ -293,7 +293,7 @@ public fun ChatTheme(
293293
messageComposerFloatingStyleEnabled: Boolean = false,
294294
colors: StreamDesign.Colors =
295295
if (isInDarkMode) StreamDesign.Colors.defaultDark() else StreamDesign.Colors.default(),
296-
dimens: StreamDimens = StreamDimens.defaultDimens(),
296+
dimens: StreamDesign.Dimens = StreamDesign.Dimens.default(),
297297
typography: StreamDesign.Typography = StreamDesign.Typography.default(),
298298
rippleConfiguration: StreamRippleConfiguration = StreamRippleConfiguration.defaultRippleConfiguration(
299299
contentColor = LocalContentColor.current,
@@ -428,9 +428,9 @@ public object ChatTheme {
428428
get() = LocalColors.current
429429

430430
/**
431-
* Retrieves the current [StreamDimens] at the call site's position in the hierarchy.
431+
* Retrieves the current [StreamDesign.Dimens] at the call site's position in the hierarchy.
432432
*/
433-
public val dimens: StreamDimens
433+
public val dimens: StreamDesign.Dimens
434434
@Composable
435435
@ReadOnlyComposable
436436
get() = LocalDimens.current

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -678,14 +678,6 @@ public object StreamDesign {
678678
) {
679679

680680
public companion object {
681-
/**
682-
* Builds the default dimensions for our theme.
683-
*
684-
* @return A [Dimens] instance holding our default dimensions.
685-
*/
686-
@Deprecated("Use default()", ReplaceWith("default()"))
687-
public fun defaultDimens(): Dimens = default()
688-
689681
/**
690682
* Builds the default dimensions for our theme.
691683
*

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

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

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/extensions/internal/AvatarPosition.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ package io.getstream.chat.android.compose.ui.util.extensions.internal
1818

1919
import androidx.compose.ui.unit.DpOffset
2020
import androidx.compose.ui.unit.dp
21-
import io.getstream.chat.android.compose.ui.theme.StreamDimens
21+
import io.getstream.chat.android.compose.ui.theme.StreamDesign
2222

2323
/**
2424
* Function to determine the offset of initials in an avatar group, which can contain up to 4 avatars in a grid.
2525
*
26-
* @param dimens [StreamDimens] that contain the offset.
26+
* @param dimens [StreamDesign.Dimens] that contain the offset.
2727
* @param userPosition The position of the current users avatar in the group.
2828
* @param memberCount The number of members inside the avatar group/channel.
2929
*
3030
* @return The x and y offset of the avatar inside [DpOffset] depending on the item position inside the list.
3131
*/
3232
internal fun getAvatarPositionOffset(
33-
dimens: StreamDimens,
33+
dimens: StreamDesign.Dimens,
3434
userPosition: Int,
3535
memberCount: Int,
3636
): DpOffset {

0 commit comments

Comments
 (0)