Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4543] & [4529] - Add a channel avatar handler to MessageListHeader and update docs #4545

Conversation

MarinTolic
Copy link
Contributor

@MarinTolic MarinTolic commented Nov 29, 2022

🎯 Goal

closes #4543
closes #4529

🛠 Implementation details

  • Added a new handler to MessageListHeader
  • Updated the docs

🧪 Testing

Patch that implements the new handler
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 f1d060ce85b7afc688375ea0e385d66a80d784ca)
+++ b/stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.kt	(date 1669738446388)
@@ -19,6 +19,7 @@
 import android.content.Context
 import android.content.Intent
 import android.os.Bundle
+import android.widget.Toast
 import androidx.activity.compose.setContent
 import androidx.activity.viewModels
 import androidx.compose.foundation.ExperimentalFoundationApi
@@ -98,7 +99,10 @@
                     onBackPressed = {
                         finish()
                     },
-                    onHeaderActionClick = {}
+                    onHeaderActionClick = {},
+                    onChannelAvatarClick = {
+                        Toast.makeText(applicationContext,"hi",Toast.LENGTH_SHORT).show()
+                    }
                 )
 
                 // MyCustomUi()
  1. Apply the patch above
  2. Enter a channel
  3. Click on the channel avatar in the messages screen

Expected: Should show toast

☑️Contributor Checklist

General

  • 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

🎉 GIF

gif

@MarinTolic MarinTolic marked this pull request as ready for review November 29, 2022 16:18
@MarinTolic MarinTolic requested a review from a team as a code owner November 29, 2022 16:18
@MarinTolic MarinTolic requested review from a team and TGazica November 29, 2022 16:18
@skydoves skydoves added the docs Either a doc problem or a question that can be avoided by improving our documentation label Nov 29, 2022
Copy link
Member

@skydoves skydoves left a comment

Choose a reason for hiding this comment

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

Overall looks good to me!

@MarinTolic MarinTolic linked an issue Dec 5, 2022 that may be closed by this pull request
Copy link
Contributor

@filbabic filbabic 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

@filbabic filbabic enabled auto-merge (squash) December 7, 2022 08:36
@filbabic filbabic merged commit 39f9f59 into develop Dec 7, 2022
@filbabic filbabic deleted the improvement/4543-add-message-list-header-channel-avatar-listener branch December 7, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Either a doc problem or a question that can be avoided by improving our documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MessageListHeader
3 participants