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

[AND-332] Chat adaptive layout #5671

Open
wants to merge 41 commits into
base: develop
Choose a base branch
from
Open

Conversation

andremion
Copy link
Contributor

@andremion andremion commented Mar 10, 2025

🎯 Goal

This is a second task of the experimental ChatsScreen introduced on #5556.

It now has a better navigation API to support navigation on phones and tablets, with better configuration changes handling.
It also supports navigation from push notifications and pinned messages where a message is focused on opening.

Note

A future task will make the pinned messages to be listed inside the adaptive layout too.

🛠 Implementation details

ChatScreen supports a three-pane adaptive layout:

  • List: Renders Channels list or Thread list according to the ListContentMode.
  • Detail: Renders a list of messages.
  • Info: Renders Channel info or Pinned messages (TBD on another task)

Panes are arranged on screen based on the device size:

  • Phone: Shows one pane at a time, covering the entire screen. Navigation is done with a slide transition.
  • Tablet: List and Detail panes are shown simultaneously, whereas List occupies 30% of the screen width and Detail occupies 70%. An optional Info pane can be displayed occupying half of the space of the Detail pane with a slide in/out transition.

Enable adaptive layout in the Advanced options of the sample app

🎨 UI Changes

Phone Tablet
Channels navigation
channels_nav_phone.webm
channels_nav_tablet.webm
Configuration changes
screen_rotation_phone.webm
screen_rotation_tablet.webm
Threads navigation
threads_phone.webm
threads_tablet.webm
Pinned navigation
nav_from_pinned_phone.webm
nav_from_pinned_tablet.webm
Push navigation
nav_from_push_phone.webm
nav_from_push_tablet.webm

🧪 Testing

Explain how this change can be tested (or why it can't be tested)

Provide a patch below if it is necessary for testing

Provide the patch summary here
Provide the patch code here

🎉 GIF

gif

Copy link
Contributor

github-actions bot commented Mar 10, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 3.17 MB 3.17 MB 0.00 MB 🟢
stream-chat-android-offline 3.38 MB 3.38 MB 0.00 MB 🟢
stream-chat-android-ui-components 7.87 MB 7.87 MB 0.00 MB 🟢
stream-chat-android-compose 9.86 MB 9.88 MB 0.02 MB 🟢

@andremion andremion changed the title [AND-332] Adaptive layout [AND-332] Chat adaptive layout Mar 10, 2025
…elFactory so that they can be used for save and restore state
@andremion andremion force-pushed the AND-332-adaptive-layout branch from d83b5e9 to 78598bc Compare March 10, 2025 13:38
@@ -308,7 +308,7 @@ internal fun DefaultMessageListHeaderSubtitle(
internal fun DefaultMessageListHeaderTrailingContent(
channel: Channel,
currentUser: User?,
onClick: () -> Unit,
onClick: (() -> Unit)?,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do not show any ripple effect when there is no click handler

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
2.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@andremion andremion marked this pull request as ready for review March 10, 2025 16:49
@andremion andremion requested a review from a team as a code owner March 10, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant