The Jetpack WindowManager library enables application developers to support new device form factors and multi-window environments. The library provides a common API surface for API versions 14 and later. The initial release targets foldable devices, but future versions will extend to more display types and window features.
Latest Update Current Stable Release Next Release Candidate Beta Release Alpha Release
November 17, 2021 - - 1.0.0-beta04 -

Declaring dependencies

To add a dependency on WindowManager, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:


dependencies {
    implementation "androidx.window:window:1.0.0-beta04"

    // For Java-friendly APIs to register and unregister callbacks
    implementation "androidx.window:window-java:1.0.0-beta04"

    // For RxJava2 integration
    implementation "androidx.window:window-rxjava2:1.0.0-beta04"

    // For RxJava3 integration
    implementation "androidx.window:window-rxjava3:1.0.0-beta04"

    // For testing
    implementation "androidx.window:window-testing:1.0.0-beta04"


dependencies {

    // For Java-friendly APIs to register and unregister callbacks

    // For RxJava2 integration

    // For RxJava3 integration

    // For testing


Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Version 1.0

Version 1.0.0-beta04

November 17, 2021

androidx.window:window-*:1.0.0-beta04 is released. Version 1.0.0-beta04 contains these commits.

New Features

  • Rename WindowInfoRepository to WindowInfoTracker.
  • Make Activity an explicit method dependency for WindowInfoTracker.
  • Add a simple TestRule for WindowMetricsCalculator to support developers using Robolectric.

API Changes

  • Extract extensions (I25a5f)
  • add isEmpty in ActivityStack (I5a4e6)
  • Rename WindowInfoRepository to WindowInfoTracker.
    • Update java/rxjava/testing dependencies to match. (I0da63)
  • Add a test rule for a simple WindowMetricsCalculator. (Ibacdb)

Version 1.0.0-beta03

October 27, 2021

androidx.window:window-*:1.0.0-beta03 is released. Version 1.0.0-beta03 contains these commits.

New Features

  • Add experimental Activity Embedding APIs. This initial layout version allows showing two Activities side by side.

API Changes

  • Removed the currentWindowMetrics API since we can not provide it accurately. Please use WindowMetricsCalculator instead (Icda5f)
  • Updated the extensions api. (Ica92b)
  • Added an interface for a new feature that allows embedding activities and showing them side-by-side within the parent task window. (I5711d)
  • Hid the constructors for WindowMetrics and WindowLayoutInfo, please use the test APIs instead. (I5a1b5)
  • Add an API to create fake WindowLayoutInfo objects. (I4a2fd)

Bug Fixes

Version 1.0.0-beta02

September 1, 2021

androidx.window:window-*:1.0.0-beta02 is released. Version 1.0.0-beta02 contains these commits.

New Features

  • Add an experimental annotation to annotate experimental APIs. (I9f1b6)
  • Add a test method to create a test FoldingFeature that accepts a Rect. This will make it easie to test when using Robolectric as opposed to an actual Activity. (Id1cca)

Version 1.0.0-beta01

August 18, 2021

androidx.window:window-*:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.

New Features

  • Removed old constants and made FoldingFeature into an interface.

API Changes

  • Remove old constants and make FoldFeature an interface. (I9a2d5)

Bug Fixes

  • Libraries that depend on the Test Core library have been upgraded to version 1.4.0 and will now work with Android platform version S. (I88b72, b/189353863)

Version 1.0.0-alpha10

August 4, 2021

androidx.window:window-*:1.0.0-alpha10 is released. Version 1.0.0-alpha10 contains these commits.

New Features

  • Rename WindowInfoRepo to WindowInfoRepository and adjust corresponding classes / files.
  • Convert current window metrics to a Flow in WindowInfoRepository since the value changes over time.
  • Rename WindowInfoRepoJavaAdapter to WindowInfoRepoCallbackAdapter
  • Add helper method to create test FoldingFeature objects
  • Update packages to group classes based on the feature they are supporting.

API Changes

  • Rename ActivityExt to ActivityExtensions Change from Repo to Repository. (I61a16)
  • Update packages for classes. (I23ae2)
  • Remove WindowMetrics from WindowInfoRepo (I24663)
  • Remove WindowManager and use WindowInfoRepo
    • Make WindowBackend internal. (I06d9a)
  • Convert window metrics to Flow.
    • Rename java adapter to WindowInfoRepoCallbackAdapter
    • Remove callbackFlow so no more experimental APIs are in use. (Ia4d15)
  • Add helper method to create test display features.
    • Change from occlusionMode to occlusionType (If4cff)

Bug Fixes

  • Fix proguard error where core library was being removed.
  • Fix error where WindowLayoutInfo was not being delivered to additional subscribers.
  • Fix error where config changes would not trigger folding feature updates.

Version 1.0.0-alpha09

June 30, 2021

androidx.window:window-*:1.0.0-alpha09 is released. Version 1.0.0-alpha09 contains these commits.

New Features

  • Change from integer constants to unbounded enums.
  • Add a test util to create test folding features.

API Changes

  • Add helper method to create test display features. (I3cf54)
    • Change from occlusionMode to occlusionType.

Bug Fixes

  • Emit initial value when adding multiple consumers of the data streams.

Version 1.0.0-alpha08

June 16, 2021

androidx.window:window-*:1.0.0-alpha08 is released. Version 1.0.0-alpha08 contains these commits.

New Features

  • Released a testing artifact to make it easier to test when using WindowInfoRepository. Use WindowInfoRepository to get information about DisplayFeatures and the WindowMetrics. (I57f66, Ida620)

Version 1.0.0-alpha07

June 2, 2021

androidx.window:window-*:1.0.0-alpha07 is released. Version 1.0.0-alpha07 contains these commits.

New Features

  • Migrate core window library to Kotlin. Will use coroutines and suspend functions to expose asynchronous data going forward.
  • Add WindowInfoRepo as the main interaction point for getting the WindowMetrics and the stream of WindowLayoutInfo.
  • New window-java artifact to expose Java-friendly APIs to register and unregister callbacks.
  • New window-rxjava2 and window-rxjava3 artifacts to expose RxJava adapted APIs.

API Changes

  • Add WindowServices to provide dependencies uniformly.
    • Add coroutine based api to consume window layout info. (Iab70f)
  • Migrate core window manager library to Kotlin. (Icca34)

Bug Fixes

  • Add new data class to represent feature bounds. (I6dcd1)

Version 1.0.0-alpha06

May 5, 2021

androidx.window:window:1.0.0-alpha06 is released. Version 1.0.0-alpha06 contains these commits.

New Features

  • We have started our migration to Kotlin and will finish in the next release.
  • DeviceState has been removed from the public API, please use FoldingFeature instead.
  • We have removed STATE_FLIPPED from the FoldingFeature states since it is not supported by any use-case at the moment.
  • We have also removed other deprecated APIs.

API Changes

  • Adding Kotlin as a dependency.
    • Migrate core library to Kotlin. (Idd995)
  • Removed DisplayFeature builder. (I61fa4)
  • Removed DeviceState from public api, use FoldingFeature instead. (Id6079)
  • Remove device state callback from extensions. (I5ea83)
  • Remove STATE_FLIPPED from FoldingFeature. (I9c4e1)
  • Remove deprecated registration methods. (Ib381b)

Version 1.0.0-alpha05

March 24, 2021

androidx.window:window:1.0.0-alpha05 is released. Version 1.0.0-alpha05 contains these commits.

New Features

We have added convenience methods to FoldingFeature so that apps can tell if the feature is separating, occluding, and determine the orientation of the hinge. We are also hiding the hinge type so that

We are removing the synchronous read methods from WindowManager. Synchronous read methods are error prone since there is an implicit race condition. Register listeners and callbacks to receive updates on the WindowLayoutInfo.

API Changes

  • Add convenience methods for working with FoldingFeatures (Ie733f)
  • Removes synchronous read methods from WindowManager (I96fd4)

Version 1.0.0-alpha04

March 10, 2021

androidx.window:window:1.0.0-alpha04 is released. Version 1.0.0-alpha04 contains these commits.

New Features

  • Fixes a bug where no WindowLayoutInfo is emitted if there isn’t an OEM implementation. Now we emit an empty WIndowLayoutInfo.
  • Fix a bug where state would not update properly if the hinge state changed while the app was backgrounded. Now the state should be consistent.
  • Update our proguard files to ignore warnings from runtime dependencies.

Bug Fixes

  • Emit an empty value when the OEM library is missing. (Ide935)

Version 1.0.0-alpha03

February 18, 2021

androidx.window:window:1.0.0-alpha03 is released. Version 1.0.0-alpha03 contains these commits.

New Features

  • Emit an empty value for WindowLayoutInfo when the OEM implementation is empty. This should make it easier to use the library on more devices. Since the APIs are asynchronous it is still recommended that apps write some defensive code and emit a default value after a timeout. We do not have any guarantees on OEM implementations and the initial value may be delayed.

Bug Fixes

  • Emit an empty value when the OEM library is missing. (Ide935)

Version 1.0.0-alpha02

January 27, 2021

androidx.window:window:1.0.0-alpha02 is released. Version 1.0.0-alpha02 contains these commits.

New Features

  • We have deprecated some APIs to help streamline the api and reduce mistakes. Some notable examples are removing the synchronous read operations from WindowManager and deprecating DeviceState. Synchronous read operations can lead to race conditions and have incorrect UI.

  • We have converted DisplayFeature to an interface that other features will implement going forward. Our first feature is FoldingFeature which is now the representation of a screen fold or a hinge. This also contains the state of the hinge replacing DeviceState.

  • WindowMetrics was introduced in Android 11 to provide developers with a simple way to query for metrics about a window, for example its position and size on screen and any system insets. We’ve backported the API in this release so that developers can leverage WindowMetrics and continue to support older Android versions. WindowMetrics can be obtained through the WindowManager#getCurrentWindowMetrics() and WindowManager#getMaximumWindowMetrics() APIs.

API Changes

  • Deprecate APIs that will be removed in the next alpha (Ib7cc4)
  • Updates ExtensionInterface to accept explicit Activity references. (I07ded)
  • Introduces the WindowMetrics API. (I3ccee)
  • Remove synchronous read methods from WindowManager (I69983)
  • Make ExtensionWindowBackend package protected. (Ied208)

Bug Fixes

  • Update ExtensionInterface APIs to accept visual contexts. (I8e827)

External Contribution

  • Merge DeviceState and WindowLayoutInfo so it is easier to access data. (Id34f4)

Version 1.0.0-alpha01

February 27, 2020

androidx.window:window:1.0.0-alpha01 and androidx.window:window-extensions:1.0.0-alpha01 are released. Version 1.0.0-alpha01 contains these commits. This is the first release of the Window Manager library.

New features

  • DisplayFeature: This new API identifies disruptions in the continuous flat screen surfaces such as hinges or folds
  • DeviceState: This new API provides the current posture of the phone from a list of defined postures (For example, CLOSED, OPENED, HALF_OPENED, etc.)