Window Manager | Android Developers
source link: https://developer.android.com/jetpack/androidx/releases/window
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Window Manager
Window Manager helps application developers support new device form factors and provide a common API surface for different Window Manager features on both old and new platform versions. The initial release is aimed at the foldable devices, and future versions will extend to more display types and window features.
Latest Update Current Stable Release Next Release Candidate Beta Release Alpha ReleaseMay 5, 2021
-
-
-
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-alpha06"
}
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-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, useFoldingFeature
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 foldsDeviceState
: This new API provides the current posture of the phone from a list of defined postures (For example,CLOSED
,OPENED
,HALF_OPENED
, etc.)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK