Window Manager
Latest Update | Current Stable Release | Next Release Candidate | Beta Release | Alpha Release |
---|---|---|---|---|
February 18, 2021 | - | - | - | 1.0.0-alpha03 |
Declaring dependencies
To add a dependency on Window Manager, 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-alpha03" }
Feedback
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.
See the Issue Tracker documentation for more information.
Version 1.0.0
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 foldsDeviceState
: This new API provides the current posture of the phone from a list of defined postures (For example,CLOSED
,OPENED
,HALF_OPENED
, etc.)