Skip to content

Commit 223088b

Browse files
authored
Applies new updates from Figma (#6308)
* Updates from Figma: - Rename `textInverse` to `textOnInverse`. - Rename `backgroundCoreSurface` to `backgroundCoreSurfaceDefault` and remove `backgroundCoreElevation4`. - Rename `borderCoreInverse` to `borderCoreOnInverse`. - Add new color properties: `borderCoreOnSurface` and `borderUtilityDisabledOnSurface`. - Update all UI components, samples, and documentation across the library to reflect the new theme property names. - Update `buttonPrimaryText` to use `accentPrimary` by default. - Adjust `controlToggleSwitchKnob` to use `backgroundCoreOnAccent`. - Update the public API signature for `StreamDesign.Colors`. * Update `StreamDesign` colors and focus border logic in `ChannelItem`. - Add `borderUtilityFocused` to `StreamDesign.Colors` to distinguish between focus and selection states. - Update `borderUtilitySelected` values for both light and dark themes to use semi-transparent slate and white, respectively. - Adjust `controlPlayButtonBg` to use a semi-transparent black instead of a solid chrome color. - Update `ChannelItem` to use `borderUtilityFocused` for the focus ring instead of `borderUtilitySelected`. - Reflect the changes in the public API signature of `StreamDesign$Colors`. * Audit Kdoc
1 parent 64aecc1 commit 223088b

23 files changed

Lines changed: 79 additions & 66 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private fun LiveLocationSharing(
137137
color = if (isOwnMessage) {
138138
ChatTheme.colors.brand.s100
139139
} else {
140-
ChatTheme.colors.backgroundCoreSurface
140+
ChatTheme.colors.backgroundCoreSurfaceDefault
141141
},
142142
),
143143
) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ class CustomLoginActivity : AppCompatActivity() {
274274
colors = TextFieldDefaults.colors(
275275
focusedTextColor = ChatTheme.colors.textPrimary,
276276
unfocusedTextColor = ChatTheme.colors.textPrimary,
277-
focusedContainerColor = ChatTheme.colors.backgroundCoreSurface,
278-
unfocusedContainerColor = ChatTheme.colors.backgroundCoreSurface,
277+
focusedContainerColor = ChatTheme.colors.backgroundCoreSurfaceDefault,
278+
unfocusedContainerColor = ChatTheme.colors.backgroundCoreSurfaceDefault,
279279
cursorColor = ChatTheme.colors.accentPrimary,
280280
focusedIndicatorColor = Color.Transparent,
281281
unfocusedIndicatorColor = Color.Transparent,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ private fun LinearProgressIndicator(
280280
modifier = Modifier.fillMaxWidth(),
281281
progress = { state.progress },
282282
color = ChatTheme.colors.accentPrimary,
283-
trackColor = ChatTheme.colors.backgroundCoreSurface,
283+
trackColor = ChatTheme.colors.backgroundCoreSurfaceDefault,
284284
drawStopIndicator = { /* Don't draw the stop indicator */ },
285285
)
286286
}
@@ -289,7 +289,7 @@ private fun LinearProgressIndicator(
289289
LinearProgressIndicator(
290290
modifier = Modifier.fillMaxWidth(),
291291
color = ChatTheme.colors.accentPrimary,
292-
trackColor = ChatTheme.colors.backgroundCoreSurface,
292+
trackColor = ChatTheme.colors.backgroundCoreSurfaceDefault,
293293
)
294294
}
295295
}

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6253,7 +6253,7 @@ public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Color
62536253
public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Colors {
62546254
public static final field $stable I
62556255
public static final field Companion Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors$Companion;
6256-
public synthetic fun <init> (Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ColorScale;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ChromeScale;JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJLkotlin/jvm/internal/DefaultConstructorMarker;)V
6256+
public synthetic fun <init> (Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ColorScale;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ChromeScale;JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJLkotlin/jvm/internal/DefaultConstructorMarker;)V
62576257
public final fun component1 ()Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ColorScale;
62586258
public final fun component10-0d7_KjU ()J
62596259
public final fun component11-0d7_KjU ()J
@@ -6311,11 +6311,13 @@ public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Color
63116311
public final fun component59-0d7_KjU ()J
63126312
public final fun component6-0d7_KjU ()J
63136313
public final fun component60-0d7_KjU ()J
6314+
public final fun component61-0d7_KjU ()J
6315+
public final fun component62-0d7_KjU ()J
63146316
public final fun component7-0d7_KjU ()J
63156317
public final fun component8-0d7_KjU ()J
63166318
public final fun component9-0d7_KjU ()J
6317-
public final fun copy-fYouhN8 (Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ColorScale;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ChromeScale;JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ)Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;
6318-
public static synthetic fun copy-fYouhN8$default (Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ColorScale;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ChromeScale;JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJIILjava/lang/Object;)Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;
6319+
public final fun copy-Gzxa-5A (Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ColorScale;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ChromeScale;JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ)Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;
6320+
public static synthetic fun copy-Gzxa-5A$default (Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ColorScale;Lio/getstream/chat/android/compose/ui/theme/StreamDesign$ChromeScale;JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJIILjava/lang/Object;)Lio/getstream/chat/android/compose/ui/theme/StreamDesign$Colors;
63196321
public fun equals (Ljava/lang/Object;)Z
63206322
public final fun getAccentError-0d7_KjU ()J
63216323
public final fun getAccentNeutral-0d7_KjU ()J
@@ -6340,29 +6342,31 @@ public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Color
63406342
public final fun getBackgroundCoreElevation1-0d7_KjU ()J
63416343
public final fun getBackgroundCoreElevation2-0d7_KjU ()J
63426344
public final fun getBackgroundCoreElevation3-0d7_KjU ()J
6343-
public final fun getBackgroundCoreElevation4-0d7_KjU ()J
63446345
public final fun getBackgroundCoreHighlight-0d7_KjU ()J
63456346
public final fun getBackgroundCoreInverse-0d7_KjU ()J
63466347
public final fun getBackgroundCoreOnAccent-0d7_KjU ()J
63476348
public final fun getBackgroundCoreOverlayDark-0d7_KjU ()J
63486349
public final fun getBackgroundCoreOverlayLight-0d7_KjU ()J
63496350
public final fun getBackgroundCoreScrim-0d7_KjU ()J
6350-
public final fun getBackgroundCoreSurface-0d7_KjU ()J
63516351
public final fun getBackgroundCoreSurfaceCard-0d7_KjU ()J
6352+
public final fun getBackgroundCoreSurfaceDefault-0d7_KjU ()J
63526353
public final fun getBackgroundCoreSurfaceStrong-0d7_KjU ()J
63536354
public final fun getBackgroundCoreSurfaceSubtle-0d7_KjU ()J
63546355
public final fun getBackgroundUtilityDisabled-0d7_KjU ()J
63556356
public final fun getBackgroundUtilitySelected-0d7_KjU ()J
63566357
public final fun getBorderCoreDefault-0d7_KjU ()J
6357-
public final fun getBorderCoreInverse-0d7_KjU ()J
63586358
public final fun getBorderCoreOnAccent-0d7_KjU ()J
6359+
public final fun getBorderCoreOnInverse-0d7_KjU ()J
6360+
public final fun getBorderCoreOnSurface-0d7_KjU ()J
63596361
public final fun getBorderCoreOpacityStrong-0d7_KjU ()J
63606362
public final fun getBorderCoreOpacitySubtle-0d7_KjU ()J
63616363
public final fun getBorderCoreStrong-0d7_KjU ()J
63626364
public final fun getBorderCoreSubtle-0d7_KjU ()J
63636365
public final fun getBorderUtilityActive-0d7_KjU ()J
63646366
public final fun getBorderUtilityDisabled-0d7_KjU ()J
6367+
public final fun getBorderUtilityDisabledOnSurface-0d7_KjU ()J
63656368
public final fun getBorderUtilityError-0d7_KjU ()J
6369+
public final fun getBorderUtilityFocused-0d7_KjU ()J
63666370
public final fun getBorderUtilitySelected-0d7_KjU ()J
63676371
public final fun getBorderUtilitySuccess-0d7_KjU ()J
63686372
public final fun getBorderUtilityWarning-0d7_KjU ()J
@@ -6371,9 +6375,9 @@ public final class io/getstream/chat/android/compose/ui/theme/StreamDesign$Color
63716375
public final fun getSkeletonLoadingBase-0d7_KjU ()J
63726376
public final fun getSkeletonLoadingHighlight-0d7_KjU ()J
63736377
public final fun getTextDisabled-0d7_KjU ()J
6374-
public final fun getTextInverse-0d7_KjU ()J
63756378
public final fun getTextLink-0d7_KjU ()J
63766379
public final fun getTextOnAccent-0d7_KjU ()J
6380+
public final fun getTextOnInverse-0d7_KjU ()J
63776381
public final fun getTextPrimary-0d7_KjU ()J
63786382
public final fun getTextSecondary-0d7_KjU ()J
63796383
public final fun getTextTertiary-0d7_KjU ()J

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ internal fun MediaAttachmentContentItem(
501501
imageRequest = imageRequest,
502502
modifier = Modifier
503503
.fillMaxSize()
504-
.background(ChatTheme.colors.backgroundCoreSurface),
504+
.background(ChatTheme.colors.backgroundCoreSurfaceDefault),
505505
contentScale = ContentScale.Crop,
506506
) { asyncImageState ->
507507
Crossfade(targetState = asyncImageState) { state ->

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ internal fun ChannelMediaAttachmentsItem(
164164
.align(Alignment.TopStart)
165165
.padding(StreamTokens.spacingXs)
166166
.size(AvatarSize.Small + borderSize)
167-
.border(borderSize, ChatTheme.colors.borderCoreInverse, CircleShape)
167+
.border(borderSize, ChatTheme.colors.borderCoreOnInverse, CircleShape)
168168
.padding(borderSize),
169169
user = item.message.user,
170170
),

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/list/ChannelItem.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public fun ChannelItem(
156156
.fillMaxWidth()
157157
.wrapContentHeight()
158158
.semantics { contentDescription = description }
159-
.applyIf(isFocused) { border(2.dp, ChatTheme.colors.borderUtilitySelected, shape) }
159+
.applyIf(isFocused) { border(2.dp, ChatTheme.colors.borderUtilityFocused, shape) }
160160
.clip(shape)
161161
.applyIf(channelItem.isSelected) { background(ChatTheme.colors.backgroundUtilitySelected, shape) }
162162
.combinedClickable(

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/list/SwipeActionItem.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public fun SwipeActionItem(
8787
val colors = ChatTheme.colors
8888
val (bg, content) = when (style) {
8989
SwipeActionStyle.Primary -> colors.accentPrimary to colors.buttonPrimaryTextOnAccent
90-
SwipeActionStyle.Secondary -> colors.backgroundCoreSurface to colors.textPrimary
90+
SwipeActionStyle.Secondary -> colors.backgroundCoreSurfaceDefault to colors.textPrimary
9191
SwipeActionStyle.Destructive -> colors.accentError to colors.buttonDestructiveTextOnAccent
9292
}
9393
SwipeActionItem(

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/ShimmerProgressIndicator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import io.getstream.chat.android.compose.ui.theme.StreamShimmerTheme
3535
@Composable
3636
internal fun ShimmerProgressIndicator(
3737
modifier: Modifier = Modifier,
38-
baseColor: Color = ChatTheme.colors.backgroundCoreSurface,
38+
baseColor: Color = ChatTheme.colors.backgroundCoreSurfaceDefault,
3939
highlightColor: Color = ChatTheme.colors.backgroundCoreApp,
4040
) {
4141
Box(

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/avatar/AvatarStack.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ internal fun UserAvatarStack(
6464
params = UserAvatarParams(
6565
modifier = Modifier
6666
.size(avatarSize + borderSize)
67-
.border(borderSize, colors.borderCoreInverse, CircleShape)
67+
.border(borderSize, colors.borderCoreOnInverse, CircleShape)
6868
.padding(borderSize),
6969
user = user,
7070
),

0 commit comments

Comments
 (0)