A foldable chat Android demonstrates adaptive and responsive UIs with Jetpack WindowManager API.
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.
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
- 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
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:
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.
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 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
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:
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:
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.
Support it by joining stargazers for this repository. ⭐️
Also, follow Stream on Twitter for our next creations!
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.