Skip to content

Commit 56ba919

Browse files
committed
Remove StreamShapes
1 parent b20d636 commit 56ba919

39 files changed

Lines changed: 84 additions & 272 deletions

File tree

stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import androidx.compose.foundation.layout.padding
3535
import androidx.compose.foundation.layout.safeDrawingPadding
3636
import androidx.compose.foundation.layout.size
3737
import androidx.compose.foundation.layout.wrapContentSize
38+
import androidx.compose.foundation.shape.RoundedCornerShape
3839
import androidx.compose.material3.Icon
3940
import androidx.compose.material3.IconButton
4041
import androidx.compose.material3.OutlinedTextField
@@ -79,7 +80,6 @@ import io.getstream.chat.android.compose.ui.theme.MessageComposerTheme
7980
import io.getstream.chat.android.compose.ui.theme.MessageOptionsTheme
8081
import io.getstream.chat.android.compose.ui.theme.ReactionOptionsTheme
8182
import io.getstream.chat.android.compose.ui.theme.StreamColors
82-
import io.getstream.chat.android.compose.ui.theme.StreamShapes
8383
import io.getstream.chat.android.compose.ui.theme.StreamTypography
8484
import io.getstream.chat.android.compose.ui.util.rememberMessageListState
8585
import io.getstream.chat.android.compose.viewmodel.messages.AttachmentsPickerViewModel
@@ -140,9 +140,8 @@ class MessagesActivity : ComponentActivity() {
140140
val isInDarkMode = isSystemInDarkTheme()
141141
val colors = if (isInDarkMode) StreamColors.defaultDarkColors() else StreamColors.defaultColors()
142142
val typography = StreamTypography.defaultTypography()
143-
val shapes = StreamShapes.defaultShapes()
144143
val messageComposerTheme = MessageComposerTheme
145-
.defaultTheme(isInDarkMode, typography, shapes, colors)
144+
.defaultTheme(isInDarkMode, typography, colors)
146145
.copy(
147146
inputField = ComposerInputFieldTheme.defaultTheme(
148147
mentionStyleFactory = CustomMentionStyleFactory(colors.accentPrimary),
@@ -152,7 +151,6 @@ class MessagesActivity : ComponentActivity() {
152151
ChatTheme(
153152
isInDarkMode = isInDarkMode,
154153
colors = colors,
155-
shapes = shapes,
156154
typography = typography,
157155
attachmentPickerConfig = AttachmentPickerConfig(useSystemPicker = false),
158156
componentFactory = CustomChatComponentFactory(locationViewModelFactory = locationViewModelFactory),
@@ -313,7 +311,7 @@ class MessagesActivity : ComponentActivity() {
313311
.align(Alignment.Center)
314312
.padding(horizontal = 20.dp)
315313
.wrapContentSize(),
316-
shape = ChatTheme.shapes.attachment,
314+
shape = RoundedCornerShape(12.dp),
317315
message = selectedMessage,
318316
onMessageAction = { action ->
319317
composerViewModel.performMessageAction(action)

stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/component/MapBox.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ import androidx.compose.foundation.ExperimentalFoundationApi
2020
import androidx.compose.foundation.combinedClickable
2121
import androidx.compose.foundation.layout.Box
2222
import androidx.compose.foundation.layout.BoxScope
23+
import androidx.compose.foundation.shape.RoundedCornerShape
2324
import androidx.compose.material3.ripple
2425
import androidx.compose.runtime.Composable
2526
import androidx.compose.ui.Modifier
2627
import androidx.compose.ui.draw.clip
2728
import androidx.compose.ui.graphics.Shape
28-
import io.getstream.chat.android.compose.ui.theme.ChatTheme
29+
import androidx.compose.ui.unit.dp
2930

3031
@OptIn(ExperimentalFoundationApi::class)
3132
@Suppress("LongParameterList")
@@ -34,7 +35,7 @@ internal fun MapBox(
3435
modifier: Modifier,
3536
latitude: Double,
3637
longitude: Double,
37-
shape: Shape = ChatTheme.shapes.attachment,
38+
shape: Shape = RoundedCornerShape(12.dp),
3839
onClick: ((url: String) -> Unit)? = null,
3940
onLongClick: ((url: String) -> Unit)? = null,
4041
content: @Composable BoxScope.() -> Unit,

stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/component/SharedLocationItem.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import androidx.compose.foundation.layout.aspectRatio
2929
import androidx.compose.foundation.layout.fillMaxWidth
3030
import androidx.compose.foundation.layout.padding
3131
import androidx.compose.foundation.layout.size
32+
import androidx.compose.foundation.shape.CircleShape
33+
import androidx.compose.foundation.shape.RoundedCornerShape
3234
import androidx.compose.material.icons.Icons
3335
import androidx.compose.material.icons.rounded.LocationOn
3436
import androidx.compose.material.icons.rounded.NearMe
@@ -130,7 +132,7 @@ private fun LiveLocationSharing(
130132
val isLiveLocationEnded = !endAt.after(Date())
131133
Column(
132134
modifier = modifier
133-
.clip(ChatTheme.shapes.attachment)
135+
.clip(RoundedCornerShape(12.dp))
134136
.background(
135137
color = if (isOwnMessage) {
136138
ChatTheme.colors.chatBgOutgoing
@@ -165,7 +167,7 @@ private fun LiveLocationSharing(
165167
.align(Alignment.Center)
166168
.background(
167169
color = animatedColor,
168-
shape = ChatTheme.shapes.avatar,
170+
shape = CircleShape,
169171
)
170172
.padding(animatedPadding.dp)
171173
.size(AvatarSize.Medium),

stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/login/CustomLoginActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class CustomLoginActivity : AppCompatActivity() {
231231
onValueChange = { onValueChange(it) },
232232
singleLine = true,
233233
label = { Text(hint) },
234-
shape = ChatTheme.shapes.inputField,
234+
shape = RoundedCornerShape(24.dp),
235235
colors = TextFieldDefaults.colors(
236236
focusedTextColor = ChatTheme.colors.textPrimary,
237237
unfocusedTextColor = ChatTheme.colors.textPrimary,

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

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,7 +3204,6 @@ public final class io/getstream/chat/android/compose/ui/theme/ChatTheme {
32043204
public final fun getReactionResolver (Landroidx/compose/runtime/Composer;I)Lio/getstream/chat/android/compose/ui/util/ReactionResolver;
32053205
public final fun getReadCountEnabled (Landroidx/compose/runtime/Composer;I)Z
32063206
public final fun getSearchResultNameFormatter (Landroidx/compose/runtime/Composer;I)Lio/getstream/chat/android/compose/ui/util/SearchResultNameFormatter;
3207-
public final fun getShapes (Landroidx/compose/runtime/Composer;I)Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes;
32083207
public final fun getShowOriginalTranslationEnabled (Landroidx/compose/runtime/Composer;I)Z
32093208
public final fun getStreamCdnImageResizing (Landroidx/compose/runtime/Composer;I)Lio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing;
32103209
public final fun getStreamDownloadAttachmentUriGenerator (Landroidx/compose/runtime/Composer;I)Lio/getstream/chat/android/ui/common/helper/DownloadAttachmentUriGenerator;
@@ -3220,7 +3219,7 @@ public final class io/getstream/chat/android/compose/ui/theme/ChatTheme {
32203219
}
32213220

32223221
public final class io/getstream/chat/android/compose/ui/theme/ChatThemeKt {
3223-
public static final fun ChatTheme (ZLio/getstream/chat/android/compose/ui/theme/ChatConfig;ZZZLio/getstream/chat/android/compose/state/messages/attachments/AttachmentPickerConfig;ZLio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Dimens;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Typography;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes;Lio/getstream/chat/android/compose/ui/theme/StreamRippleConfiguration;Lio/getstream/chat/android/ui/common/model/UserPresence;Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Ljava/util/List;Ljava/util/List;Lio/getstream/chat/android/compose/ui/util/ReactionResolver;Lio/getstream/chat/android/compose/ui/theme/ReactionOptionsTheme;Lio/getstream/chat/android/compose/ui/util/MessagePreviewIconFactory;Lio/getstream/chat/android/compose/ui/util/PollSwitchItemFactory;ZLio/getstream/chat/android/ui/common/helper/DateFormatter;Lio/getstream/chat/android/ui/common/helper/TimeProvider;Lio/getstream/chat/android/ui/common/helper/DurationFormatter;Lio/getstream/chat/android/ui/common/utils/ChannelNameFormatter;Lio/getstream/chat/android/compose/ui/util/MessagePreviewFormatter;Lio/getstream/chat/android/compose/ui/util/SearchResultNameFormatter;Lio/getstream/chat/android/compose/ui/util/StreamCoilImageLoaderFactory;Lio/getstream/chat/android/ui/common/helper/ImageHeadersProvider;Lio/getstream/chat/android/ui/common/helper/DownloadAttachmentUriGenerator;Lio/getstream/chat/android/ui/common/helper/DownloadRequestInterceptor;Lio/getstream/chat/android/ui/common/helper/ImageAssetTransformer;Lio/getstream/chat/android/compose/ui/util/MessageAlignmentProvider;Lio/getstream/chat/android/compose/ui/theme/MessageOptionsTheme;Lio/getstream/chat/android/compose/ui/theme/ChannelOptionsTheme;ZLio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing;ZLio/getstream/chat/android/compose/ui/theme/MessageComposerTheme;Lio/getstream/chat/android/compose/ui/util/MessageTextFormatter;Lio/getstream/sdk/chat/audio/recording/StreamMediaRecorder;Lio/getstream/chat/android/compose/ui/theme/StreamKeyboardBehaviour;Lio/getstream/chat/android/compose/ui/attachments/preview/MediaGalleryConfig;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;IIIIIII)V
3222+
public static final fun ChatTheme (ZLio/getstream/chat/android/compose/ui/theme/ChatConfig;ZZZLio/getstream/chat/android/compose/state/messages/attachments/AttachmentPickerConfig;ZLio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Dimens;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Typography;Lio/getstream/chat/android/compose/ui/theme/StreamRippleConfiguration;Lio/getstream/chat/android/ui/common/model/UserPresence;Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Ljava/util/List;Ljava/util/List;Lio/getstream/chat/android/compose/ui/util/ReactionResolver;Lio/getstream/chat/android/compose/ui/theme/ReactionOptionsTheme;Lio/getstream/chat/android/compose/ui/util/MessagePreviewIconFactory;Lio/getstream/chat/android/compose/ui/util/PollSwitchItemFactory;ZLio/getstream/chat/android/ui/common/helper/DateFormatter;Lio/getstream/chat/android/ui/common/helper/TimeProvider;Lio/getstream/chat/android/ui/common/helper/DurationFormatter;Lio/getstream/chat/android/ui/common/utils/ChannelNameFormatter;Lio/getstream/chat/android/compose/ui/util/MessagePreviewFormatter;Lio/getstream/chat/android/compose/ui/util/SearchResultNameFormatter;Lio/getstream/chat/android/compose/ui/util/StreamCoilImageLoaderFactory;Lio/getstream/chat/android/ui/common/helper/ImageHeadersProvider;Lio/getstream/chat/android/ui/common/helper/DownloadAttachmentUriGenerator;Lio/getstream/chat/android/ui/common/helper/DownloadRequestInterceptor;Lio/getstream/chat/android/ui/common/helper/ImageAssetTransformer;Lio/getstream/chat/android/compose/ui/util/MessageAlignmentProvider;Lio/getstream/chat/android/compose/ui/theme/MessageOptionsTheme;Lio/getstream/chat/android/compose/ui/theme/ChannelOptionsTheme;ZLio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing;ZLio/getstream/chat/android/compose/ui/theme/MessageComposerTheme;Lio/getstream/chat/android/compose/ui/util/MessageTextFormatter;Lio/getstream/sdk/chat/audio/recording/StreamMediaRecorder;Lio/getstream/chat/android/compose/ui/theme/StreamKeyboardBehaviour;Lio/getstream/chat/android/compose/ui/attachments/preview/MediaGalleryConfig;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;IIIIIII)V
32243223
public static final fun getLocalAttachmentPickerConfig ()Landroidx/compose/runtime/ProvidableCompositionLocal;
32253224
public static final fun getLocalComponentFactory ()Landroidx/compose/runtime/ProvidableCompositionLocal;
32263225
public static final fun getLocalComposerLinkPreviewEnabled ()Landroidx/compose/runtime/ProvidableCompositionLocal;
@@ -3381,7 +3380,7 @@ public final class io/getstream/chat/android/compose/ui/theme/ComposerInputField
33813380
}
33823381

33833382
public final class io/getstream/chat/android/compose/ui/theme/ComposerInputFieldTheme$Companion {
3384-
public final fun defaultTheme (Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Typography;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;Lio/getstream/chat/android/compose/ui/theme/MentionStyleFactory;Landroidx/compose/runtime/Composer;II)Lio/getstream/chat/android/compose/ui/theme/ComposerInputFieldTheme;
3383+
public final fun defaultTheme (Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Typography;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;Lio/getstream/chat/android/compose/ui/theme/MentionStyleFactory;Landroidx/compose/runtime/Composer;II)Lio/getstream/chat/android/compose/ui/theme/ComposerInputFieldTheme;
33853384
}
33863385

33873386
public final class io/getstream/chat/android/compose/ui/theme/CompoundComponentFactoryKt {
@@ -3445,7 +3444,7 @@ public final class io/getstream/chat/android/compose/ui/theme/MessageComposerThe
34453444
}
34463445

34473446
public final class io/getstream/chat/android/compose/ui/theme/MessageComposerTheme$Companion {
3448-
public final fun defaultTheme (ZLio/getstream/chat/android/compose/ui/theme/StreamDesign$Typography;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;Landroidx/compose/runtime/Composer;II)Lio/getstream/chat/android/compose/ui/theme/MessageComposerTheme;
3447+
public final fun defaultTheme (ZLio/getstream/chat/android/compose/ui/theme/StreamDesign$Typography;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;Landroidx/compose/runtime/Composer;II)Lio/getstream/chat/android/compose/ui/theme/MessageComposerTheme;
34493448
}
34503449

34513450
public final class io/getstream/chat/android/compose/ui/theme/MessageFooterStatusIndicatorParams {
@@ -3877,44 +3876,6 @@ public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Dimen
38773876
public final fun defaultDimens ()Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Dimens;
38783877
}
38793878

3880-
public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes {
3881-
public static final field $stable I
3882-
public static final field Companion Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes$Companion;
3883-
public fun <init> (Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;)V
3884-
public final fun component1 ()Landroidx/compose/ui/graphics/Shape;
3885-
public final fun component10 ()Landroidx/compose/ui/graphics/Shape;
3886-
public final fun component11 ()Landroidx/compose/ui/graphics/Shape;
3887-
public final fun component2 ()Landroidx/compose/ui/graphics/Shape;
3888-
public final fun component3 ()Landroidx/compose/ui/graphics/Shape;
3889-
public final fun component4 ()Landroidx/compose/ui/graphics/Shape;
3890-
public final fun component5 ()Landroidx/compose/ui/graphics/Shape;
3891-
public final fun component6 ()Landroidx/compose/ui/graphics/Shape;
3892-
public final fun component7 ()Landroidx/compose/ui/graphics/Shape;
3893-
public final fun component8 ()Landroidx/compose/ui/graphics/Shape;
3894-
public final fun component9 ()Landroidx/compose/ui/graphics/Shape;
3895-
public final fun copy (Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;)Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes;
3896-
public static synthetic fun copy$default (Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;Landroidx/compose/ui/graphics/Shape;ILjava/lang/Object;)Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes;
3897-
public fun equals (Ljava/lang/Object;)Z
3898-
public final fun getAttachment ()Landroidx/compose/ui/graphics/Shape;
3899-
public final fun getAvatar ()Landroidx/compose/ui/graphics/Shape;
3900-
public final fun getBottomSheet ()Landroidx/compose/ui/graphics/Shape;
3901-
public final fun getHeader ()Landroidx/compose/ui/graphics/Shape;
3902-
public final fun getImageThumbnail ()Landroidx/compose/ui/graphics/Shape;
3903-
public final fun getInputField ()Landroidx/compose/ui/graphics/Shape;
3904-
public final fun getMyMessageBubble ()Landroidx/compose/ui/graphics/Shape;
3905-
public final fun getOtherMessageBubble ()Landroidx/compose/ui/graphics/Shape;
3906-
public final fun getPollOptionInput ()Landroidx/compose/ui/graphics/Shape;
3907-
public final fun getQuotedAttachment ()Landroidx/compose/ui/graphics/Shape;
3908-
public final fun getSuggestionList ()Landroidx/compose/ui/graphics/Shape;
3909-
public fun hashCode ()I
3910-
public fun toString ()Ljava/lang/String;
3911-
}
3912-
3913-
public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes$Companion {
3914-
public final fun default ()Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes;
3915-
public final fun defaultShapes ()Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes;
3916-
}
3917-
39183879
public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Typography {
39193880
public static final field $stable I
39203881
public static final field Companion Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Typography$Companion;
@@ -4162,7 +4123,6 @@ public abstract interface class io/getstream/chat/android/compose/ui/util/Messag
41624123
public final class io/getstream/chat/android/compose/ui/util/MessageTextFormatter$Companion {
41634124
public final fun composite ([Lio/getstream/chat/android/compose/ui/util/MessageTextFormatter;)Lio/getstream/chat/android/compose/ui/util/MessageTextFormatter;
41644125
public final fun defaultFormatter (ZZLio/getstream/chat/android/compose/ui/theme/StreamDesign$Typography;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)Lio/getstream/chat/android/compose/ui/util/MessageTextFormatter;
4165-
public final fun defaultFormatter (ZZLio/getstream/chat/android/compose/ui/theme/StreamDesign$Typography;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Shapes;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)Lio/getstream/chat/android/compose/ui/util/MessageTextFormatter;
41664126
}
41674127

41684128
public final class io/getstream/chat/android/compose/ui/util/MessageUtilsKt {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public fun FileAttachmentImage(
221221
if (data != null) {
222222
val showThumbnail = attachment.isImage() || attachment.isVideo() && ChatTheme.videoThumbnailsEnabled
223223
val imageModifier = if (showThumbnail) {
224-
baseModifier.clip(ChatTheme.shapes.imageThumbnail)
224+
baseModifier.clip(RoundedCornerShape(StreamTokens.radiusMd))
225225
} else {
226226
baseModifier
227227
}

0 commit comments

Comments
 (0)