Jetchat is a sample chat app built with Jetpack Compose.

Overview

Jetchat sample

Jetchat is a sample chat app built with Jetpack Compose.

To try out this sample app, you need to use Android Studio Arctic Fox You can clone this repository or import the project from Android Studio following the steps here.

This sample showcases:

  • UI state management
  • Integration with Architecture Components: Navigation, Fragments, ViewModel
  • Back button handling
  • Text Input and focus management
  • Multiple types of animations and transitions
  • Saved state across configuration changes
  • Material Design 3 theming and Material You dynamic color
  • UI tests

Status: 🚧 In progress

Jetchat is still in under development, and some features are not yet implemented.

Features

UI State management

The ConversationContent composable is the entry point to this screen and takes a ConversationUiState that defines the data to be displayed. This doesn't mean all the state is served from a single point: composables can have their own state too. For an example, see scrollState in ConversationContent or currentInputSelector in UserInput

Architecture Components

The ProfileFragment shows how to pass data between fragments with the Navigation component and observe state from a ViewModel, served via LiveData.

Back button handling

When the Emoji selector is shown, pressing back in the app closes it, intercepting any navigation events. This feature shows a way to integrate Compose and APIs from the Android Framework like OnBackPressedDispatcherOwner via Ambients. The implementation can be found in ConversationUiState.

Text Input and focus management

When the Emoji panel is shown the keyboard must be hidden and vice versa. This is achieved with a combination of the FocusRequester and onFocusChanged APIs.

Multiple types of animations and transitions

This sample uses animations ranging from simple AnimatedVisibility in FunctionalityNotAvailablePanel to choreographed transitions found in the FloatingActionButton of the Profile screen and implemented in AnimatingFabContent

Edge-to-edge UI with synchronized IME transitions

This sample is laid out edge-to-edge, drawing its content behind the system bars for a more immersive look.

The sample also supports synchronized IME transitions when running on API 30+ devices. See the use of Modifier.navigationBarsWithImePadding() in ConversationContent.

The sample uses the Accompanist Insets library for WindowInsets support.

Saved state across configuration changes

Some composable state survives activity or process recreation, like currentInputSelector in UserInput.

Material Design 3 theming and Material You dynamic color

Jetchat follows the Material Design 3 principles and uses the MaterialTheme composable and M3 components. On Android 12+ Jetchat supports Material You dynamic color, which extracts a custom color scheme from the device wallpaper. Jetchat uses a custom, branded color scheme as a fallback. It also implements custom typography using the Karla and Montserrat font families.

UI tests

In androidTest you'll find a suite of UI tests that showcase interesting patterns in Compose:

ConversationTest

UI tests for the Conversation screen. Includes a test that checks the behavior of the app when dark mode changes.

NavigationTest

Shows how to write tests that assert directly on the Navigation Controller.

UserInputTest

Checks that the user input composable, including extended controls, behave as expected showing and hiding the keyboard.

Known issues

  1. If the emoji selector is shown, clicking on the TextField can sometimes show both input methods. Tracked in https://issuetracker.google.com/164859446

  2. There are only two profiles, clicking on anybody except "me" will show the same data.

License

Copyright 2020 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Android Real Time Chat & Messaging SDK
Android Real Time Chat & Messaging SDK

Android Chat SDK Overview Applozic brings real-time engagement with chat, video, and voice to your web, mobile, and conversational apps. We power emer

Kommunicate.io Android Chat SDK for Customer Support
Kommunicate.io Android Chat SDK for Customer Support

Kommunicate Android Chat SDK for Customer Support An Open Source Android Live Chat SDK for Customer Support Overview Kommunicate provides open source

Wurst Plus 3 Chat Server

Wurst Plus 3 Chat Server This is a server for wurst + 3! Ideas/TODO Friend requests Secure key for clients DMs Global Chat Friend's Online Color/rainb

A hybrid chat android application based on the features of Instagram and Whatsapp having UI just as Telegram.
A hybrid chat android application based on the features of Instagram and Whatsapp having UI just as Telegram.

A hybrid chat android application based on the features of Instagram and Whatsapp having UI just as Telegram.

Simple chat box written in kotlin, requires a redis server
Simple chat box written in kotlin, requires a redis server

Chat Box A simple chat box written in kotlin which requires a redis server to be used. Features Command Support Online User storage in Redis Easy to u

Fire Chat
Fire Chat

Fire Chat A one-to-one chat app (similar to WhatsApp) built using Kotlin and Firebase. Sceenshots Whenever a user will enter the app a registration pa

 AvengersChat is a demo application based on modern Android tech stacks and Stream Chat SDK.
AvengersChat is a demo application based on modern Android tech stacks and Stream Chat SDK.

💙 Android sample Avengers chat application using Stream Chat SDK based on MVVM (ViewModel, Coroutines, Room, Hilt, Repository) architecture.

Biblioteca Kotlin com objetivo de facilitar a criação de aplicações de Chat e Chatbots voltadas a Twitch.

Twitch4K O Twitch4K é uma biblioteca Kotlin que tem como objetivo principal facilitar a criação de aplicações de Chat e Chatbots voltadas para a plata

This command line program can extract chat messages send on the Minecraft server HGLabor

HGLabor-Log-Extractor Das Programm durchläuft einmalig deine Minecraft-Logs und sammelt alle Nachrichten heraus, die auf HGLabor geschrieben wurden. K

Owner
Elye
Android Dev
Elye
💙 Android sample Avengers chat application using Stream Chat SDK based on MVVM (ViewModel, Coroutines, Room, Hilt, Repository) architecture.

Avengers Chat AvengersChat is a demo application based on modern Android tech stacks and Stream Chat SDK. Previews Download Go to the Releases to down

Jaewoong Eum 352 Dec 25, 2022
This is a Bluetooth operational Chat-App developed using Kotlin which shows the list of available devices nearby and paired devices, upon clicking you can start chat

This is a Bluetooth operational Chat-App developed using Kotlin which shows the list of available devices nearby and paired devices, upon clicking you can start chat ... VOILA ???? It is still in its early stages of development and currently let user to one-time chat at a time. It is under heavy development ??

Shalu Ambasta 3 Jan 10, 2022
Multi Lingual Chat app - A modern chat application that allows users to translate text messages into their preferred language

Multi Lingual Chat app - A modern chat application that allows users to translate text messages into their preferred language

Manjunath Nayak 0 Jan 18, 2022
Firebase-Chat-App-Final - An android real-time chat application implemented using firebase

Firebase-Chat-App-Final An android real-time chat application implemented using

Tanmay Nandanikar 4 Sep 10, 2022
Server/Client Chatting application that allows to choose to chat in a group chat or privately to a specific connected user

ktor_chatting_application Server/Client Chatting application that uses Ktor webs

null 10 Jun 14, 2022
Shit Chat is a realtime chat application made with Kotlin.

Shit Chat Shit Chat is a realtime chat application made with Kotlin. Screeshots : Login UI Sign Up UI User List UI Chat UI Features Store Chat on Fire

Vishal Singh 2 Oct 26, 2022
A private-chat-only Android App for Secure Scuttlebutt

Tremola README Tremola is a Secure Scuttlebutt (SSB) client for Android that only supports private chat. Tremola aims at having the same functionality

Computer Networks Group 29 Oct 30, 2022
Android Combined Application for chat, audio/video calls, and broadcast to millions of web and app users using VdoTok SDK.

Android Combined Application for chat, audio/video calls, and broadcast to millions of web and app users using VdoTok SDK.

VdoTok 3 Nov 22, 2022
A chat app for Android written in Kotlin using MVVM.

Chat App Android About A chat app for Android written in Kotlin using MVVM. Features Authentication: Email and password Google Auth Reset Password Sen

Sreshtha Mehrotra 14 Jul 3, 2022
A chat app for Android written in Kotlin using MVVM.

Chat App Android About A chat app for Android written in Kotlin using MVVM. Features Authentication: Email and password Google Auth Reset Password Sen

Sreshtha Mehrotra 14 Jul 3, 2022