Skip to content

Conversation

bychkovdmitry
Copy link
Contributor

@bychkovdmitry bychkovdmitry commented Nov 1, 2022

🎯 Goal

Closes #4326

🛠 Implementation details

Added some options to StreamColors, to make it possible to customize the appearance of quoted messages.

  • StreamColors.ownMessageQuotedBackground
  • StreamColors.otherMessageQuotedBackground
  • StreamColors.ownMessageQuotedText
  • StreamColors.otherMessageQuotedText

🎨 UI Changes

Before After
photo_2022-11-01 16 27 11 photo_2022-11-01 16 27 08
photo_2022-11-01 16 30 39 photo_2022-11-01 16 30 40

🧪 Testing

Apply the patch below with the modified colors:

StreamColors.defaultColors().copy(
     ownMessageQuotedBackground = Color.Green,
     otherMessageQuotedBackground = Color.Red,
     ownMessageQuotedText = Color.Blue,
     otherMessageQuotedText = Color.Yellow,
)
Provide the patch summary here
Index: stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.kt b/stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.kt
--- a/stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.kt	(revision 816b0920e7e76a1015437c3f7df528aafd18492d)
+++ b/stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.kt	(date 1667310092529)
@@ -47,6 +47,7 @@
 import androidx.compose.runtime.remember
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.res.painterResource
 import androidx.compose.ui.unit.dp
 import io.getstream.chat.android.common.state.DeletedMessageVisibility
@@ -68,6 +69,7 @@
 import io.getstream.chat.android.compose.ui.messages.composer.MessageComposer
 import io.getstream.chat.android.compose.ui.messages.list.MessageList
 import io.getstream.chat.android.compose.ui.theme.ChatTheme
+import io.getstream.chat.android.compose.ui.theme.StreamColors
 import io.getstream.chat.android.compose.viewmodel.messages.AttachmentsPickerViewModel
 import io.getstream.chat.android.compose.viewmodel.messages.MessageComposerViewModel
 import io.getstream.chat.android.compose.viewmodel.messages.MessageListViewModel
@@ -93,7 +95,15 @@
         val channelId = intent.getStringExtra(KEY_CHANNEL_ID) ?: return
 
         setContent {
-            ChatTheme(dateFormatter = ChatApp.dateFormatter) {
+            ChatTheme(
+                dateFormatter = ChatApp.dateFormatter,
+                colors  =  StreamColors.defaultColors().copy(
+                    ownMessageQuotedBackground = Color.Green,
+                    otherMessageQuotedBackground = Color.Red,
+                    ownMessageQuotedText = Color.Blue,
+                    otherMessageQuotedText = Color.Yellow,
+                ),
+            ) {
                 MessagesScreen(
                     channelId = channelId,
                     onBackPressed = { finish() },

And verify that the result looks like that:

photo_2022-11-01 16 44 18

☑️Contributor Checklist

General

  • I have signed the Stream CLA (required)
  • Assigned a person / code owner group (required)
  • Thread with the PR link started in a respective Slack channel (#android-chat-core or #android-chat-ui) (required)
  • PR targets the develop branch
  • PR is linked to the GitHub issue it resolves

Code & documentation

  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (KDocs, docusaurus, tutorial)

☑️Reviewer Checklist

  • UI Components sample runs & works
  • Compose sample runs & works
  • UI Changes correct (before & after images)
  • Bugs validated (bugfixes)
  • New feature tested and works
  • Release notes and docs clearly describe changes
  • All code we touched has new or updated KDocs

@bychkovdmitry bychkovdmitry added the compose Jetpack Compose label Nov 1, 2022
@bychkovdmitry bychkovdmitry linked an issue Nov 1, 2022 that may be closed by this pull request
@bychkovdmitry bychkovdmitry force-pushed the bugfix/4326-fix-color-in-quoted-message branch from e9de928 to a3b0218 Compare November 1, 2022 13:56
@bychkovdmitry bychkovdmitry marked this pull request as ready for review November 1, 2022 14:00
@bychkovdmitry bychkovdmitry requested a review from a team as a code owner November 1, 2022 14:00
@bychkovdmitry bychkovdmitry requested a review from a team November 1, 2022 14:00
Copy link
Contributor

@MarinTolic MarinTolic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☑️Reviewer Checklist

  • UI Components sample runs & works
  • Compose sample runs & works
  • UI Changes correct (before & after images)
  • Bugs validated (bugfixes)
  • New feature tested and works
  • Release notes and docs clearly describe changes
  • All code we touched has new or updated KDocs

bychkovdmitry and others added 4 commits November 2, 2022 20:59
Co-authored-by: Marin Tolić <37080097+MarinTolic@users.noreply.github.com>
…droid/compose/ui/theme/StreamColors.kt

Co-authored-by: Marin Tolić <37080097+MarinTolic@users.noreply.github.com>
@bychkovdmitry bychkovdmitry enabled auto-merge (squash) November 2, 2022 18:17
@bychkovdmitry bychkovdmitry merged commit c21cb54 into v5 Nov 2, 2022
@bychkovdmitry bychkovdmitry deleted the bugfix/4326-fix-color-in-quoted-message branch November 2, 2022 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compose Jetpack Compose
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Text color issue in Quoted Message
2 participants