Foldable Chat Android
A foldable chat Android demonstrates adaptive and responsive UIs with Jetpack WindowManager API.
Overview
This demo project demonstrates dual-screen devices are portable devices with two symmetric screens that work together in unique ways to provide productivity in a flexible form factor. For more details, you can check it out Introduction to dual-screen devices.
Learn More about WindowManager
If you would like to learn more about the WindowManager API, check out the resources below:
- Exploring Jetpack WindowManager for Foldable Devices.
- Youtube Tutorial - Exploring Jetpack WindowManager to Support Foldable Devices
Pre-requisites
- Android SDK 31
- Android Studio Arctic Fox or higher
- Android Gradle Plugin 7.0.1+ and Java 11
- The Android Emulator v30.0.6+ includes foldables support
- Surface Duo 2 emulator
Install and run the Foldable Emulator
To get started, you need to install the Foldable emulator. This project uses Surface Duo 2 emulator, and you can check it out the links below:
Jetpack WindowManager
The Jetpack WindowManager library targets foldable devices and enables application developers to support new device form factors and multi-window environments. You can find Jetpack WindowManager information in the Guide: Learn about foldables.
Including on your project
Add the below dependencies to your build.gradle
file.
dependencies {
implementation "androidx.window:window:1.0.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2"
}
WindowManager Example
WindowManager Example module shows how to calculate the screen size and determine device postures with Jetpack WindowManager. You can also refer to the links below for additional help:
- Exploring Jetpack WindowManager for Foldable Devices
- Support foldable and dual-screen devices with Jetpack WindowManager
- Unbundling the WindowManager
- Migrate your UI to responsive layouts
Preview
WindowManager Chat
WindowManager Chat module demonstrates how to build responsive chat UIs with XML layout with Stream Chat SDK. You can also refer to the links below for additional help:
Preview
WindowManager Chat Compose
WindowManager Chat Compose module demonstrates how to build responsive chat UIs with Stream Jetpack Compose SDK. You can also refer to the links below for additional help:
Preview
Butterfly
If you're looking for useful APIs for Jetpack WindowManager, check out the Butterfly. The Butterfly helps you to build adaptive and responsive UIs for Android with Jetpack WindowManager. Also, it supports useful functions for Jetpack Compose and LiveData integration.
❤️
Find this library useful? Support it by joining stargazers for this repository.
Also, follow Stream on Twitter for our next creations!
License
Copyright 2022 Stream.IO, Inc. All Rights Reserved.
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
http://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.