/compose-chat-tutorial

Sample app for the Stream Chat Compose SDK's official tutorial

Primary LanguageKotlinBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Compose Chat Tutorial Sample

This repository allows you to check the result after completing the Compose Chat Tutorial.

Not using Compose yet? Check out the tutorial repo of our XML based UI components instead.

The project is pre-configured with a shared Stream account for testing purposes. You can learn more about Stream Chat here, and then sign up for an account and obtain your own keys here.

Quick start

  1. Clone the repository
  2. Open the project in Android Studio (Arctic Fox or later)
  3. Run the app
  4. Make sure to check the Details section below for the different steps

Details

The tutorial app consists of two screens:

  • MainActivity: Shows the list of available channels.
  • MessagesActivity: Shows the selected channel view, which includes the header, message list, and message input view.

There are a handful of MessagesActivity implementations, which correspond to the steps of the tutorial. You can easily swap them by changing the onChannelClick handler located in MainActivity:

onChannelClick = { channel ->
    startActivity(MessagesActivity4.getIntent(this, channel.cid))
},

You can choose from four different MessagesActivity implementations:

  • MessagesActivity - a basic Message Screen implementation
  • MessagesActivity2 - includes customization of the screen by using ChatTheme
  • MessagesActivity3 - uses bound and stateless components to build the chat screen, with further customization
  • MessagesActivity4 - uses a custom message composer component for extended customization