Skip to content

Commit 510f706

Browse files
authored
Update design of the selected message menu (#6174)
* Update design of the selected message menu * Update Paparazzi test & snapshots * Rename composition local * Remove stale kdoc * Increase dialog dim amount * Add test tags * Add test tags * Update icon color
1 parent 35528a8 commit 510f706

25 files changed

Lines changed: 601 additions & 626 deletions

stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/reminders/MessageRemindersComponentFactory.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ import io.getstream.chat.android.compose.sample.R
3232
import io.getstream.chat.android.compose.sample.ui.component.DeleteMessageForMeComponentFactory
3333
import io.getstream.chat.android.compose.state.messageoptions.MessageOptionItemState
3434
import io.getstream.chat.android.compose.ui.theme.ChatComponentFactory
35-
import io.getstream.chat.android.compose.ui.theme.ChatTheme
3635
import io.getstream.chat.android.models.Message
3736
import io.getstream.chat.android.models.ReactionSorting
37+
import io.getstream.chat.android.models.User
3838
import io.getstream.chat.android.ui.common.state.messages.CustomAction
3939
import io.getstream.chat.android.ui.common.state.messages.MessageAction
4040
import io.getstream.chat.android.ui.common.state.messages.list.MessageItemState
@@ -96,6 +96,7 @@ class MessageRemindersComponentFactory(
9696
onMessageAction: (MessageAction) -> Unit,
9797
onShowMore: () -> Unit,
9898
onDismiss: () -> Unit,
99+
currentUser: User?,
99100
) {
100101
val remindMeOption = remindMeOption(message)
101102
val saveForLaterOption = saveForLaterOption(message)
@@ -167,6 +168,7 @@ class MessageRemindersComponentFactory(
167168
onMessageAction = extendedAction,
168169
onShowMore = onShowMore,
169170
onDismiss = onDismiss,
171+
currentUser = currentUser,
170172
)
171173
}
172174

@@ -190,9 +192,8 @@ class MessageRemindersComponentFactory(
190192
}
191193
return MessageOptionItemState(
192194
title = title,
193-
titleColor = ChatTheme.colors.textHighEmphasis,
194195
iconPainter = painterResource(icon),
195-
iconColor = ChatTheme.colors.textLowEmphasis,
196+
destructive = false,
196197
action = CustomAction(message, mapOf(ACTION_TYPE to actionType)),
197198
)
198199
}
@@ -217,9 +218,8 @@ class MessageRemindersComponentFactory(
217218
}
218219
return MessageOptionItemState(
219220
title = title,
220-
titleColor = ChatTheme.colors.textHighEmphasis,
221221
iconPainter = painterResource(icon),
222-
iconColor = ChatTheme.colors.textLowEmphasis,
222+
destructive = false,
223223
action = CustomAction(message, mapOf(ACTION_TYPE to actionType)),
224224
)
225225
}

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

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,15 @@ class MessagesActivity : ComponentActivity() {
175175

176176
@Composable
177177
private fun SetupContent() {
178-
Column {
179-
MessagesScreen(
180-
viewModelFactory = factory,
181-
reactionSorting = ReactionSortingByLastReactionAt,
182-
onBackPressed = { finish() },
183-
onHeaderTitleClick = ::openChannelInfo,
184-
onMessageLinkClick = { _, link ->
185-
openLink(link)
186-
},
187-
)
188-
}
178+
MessagesScreen(
179+
viewModelFactory = factory,
180+
reactionSorting = ReactionSortingByLastReactionAt,
181+
onBackPressed = { finish() },
182+
onHeaderTitleClick = ::openChannelInfo,
183+
onMessageLinkClick = { _, link ->
184+
openLink(link)
185+
},
186+
)
189187
// MyCustomUi()
190188
}
191189

@@ -270,7 +268,6 @@ class MessagesActivity : ComponentActivity() {
270268
.align(Alignment.Center)
271269
.padding(horizontal = 20.dp)
272270
.wrapContentSize(),
273-
shape = ChatTheme.shapes.attachment,
274271
messageOptions = defaultMessageOptionsState(
275272
selectedMessage = selectedMessage,
276273
currentUser = user,

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import io.getstream.chat.android.compose.ui.components.SimpleDialog
3636
import io.getstream.chat.android.compose.ui.theme.ChatComponentFactory
3737
import io.getstream.chat.android.compose.ui.theme.ChatTheme
3838
import io.getstream.chat.android.models.Message
39+
import io.getstream.chat.android.models.User
3940
import io.getstream.chat.android.ui.common.state.messages.CustomAction
4041
import io.getstream.chat.android.ui.common.state.messages.Delete
4142
import io.getstream.chat.android.ui.common.state.messages.MessageAction
@@ -62,6 +63,7 @@ class DeleteMessageForMeComponentFactory(
6263
onMessageAction: (MessageAction) -> Unit,
6364
onShowMore: () -> Unit,
6465
onDismiss: () -> Unit,
66+
currentUser: User?,
6567
) {
6668
val chatClient = ChatClient.instance()
6769

@@ -84,9 +86,8 @@ class DeleteMessageForMeComponentFactory(
8486
add(
8587
MessageOptionItemState(
8688
title = R.string.message_option_delete_for_me,
87-
titleColor = ChatTheme.colors.errorAccent,
8889
iconPainter = painterResource(R.drawable.stream_compose_ic_delete),
89-
iconColor = ChatTheme.colors.errorAccent,
90+
destructive = true,
9091
action = CustomAction(message, mapOf("delete_for_me" to true)),
9192
),
9293
)
@@ -127,6 +128,7 @@ class DeleteMessageForMeComponentFactory(
127128
onMessageAction = extendedOnMessageAction,
128129
onShowMore = onShowMore,
129130
onDismiss = onDismiss,
131+
currentUser = currentUser,
130132
)
131133
}
132134

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ class MessageInfoComponentFactory : ChatComponentFactory {
8787
onMessageAction: (MessageAction) -> Unit,
8888
onShowMore: () -> Unit,
8989
onDismiss: () -> Unit,
90+
currentUser: User?,
9091
) {
9192
var showMessageInfoDialog by remember { mutableStateOf(false) }
9293

9394
val allOptions = listOf(
9495
MessageOptionItemState(
9596
title = R.string.message_option_message_info,
96-
titleColor = ChatTheme.colors.textHighEmphasis,
9797
iconPainter = rememberVectorPainter(Icons.Outlined.Info),
98-
iconColor = ChatTheme.colors.textLowEmphasis,
98+
destructive = false,
9999
action = CustomAction(message, mapOf("message_info" to true)),
100100
),
101101
) + messageOptions
@@ -139,6 +139,7 @@ class MessageInfoComponentFactory : ChatComponentFactory {
139139
onMessageAction = extendedOnMessageAction,
140140
onShowMore = onShowMore,
141141
onDismiss = onDismiss,
142+
currentUser = currentUser,
142143
)
143144
}
144145
}

0 commit comments

Comments
 (0)