# WindowInfoTracker

Artifact: [androidx.window:window](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/layout/WindowInfoTracker.kt+class:androidx.window.layout.WindowInfoTracker) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/window#1.0.0)

*** ** * ** ***

<br />

```
interface WindowInfoTracker
```

<br />

Known direct subclasses [WindowInfoTrackerCallbackAdapter](https://developer.android.com/reference/kotlin/androidx/window/java/layout/WindowInfoTrackerCallbackAdapter)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/java/layout/WindowInfoTrackerCallbackAdapter` | **This class is deprecated.** This adapter is no longer necessary. |

*** ** * ** ***

An interface to provide all the relevant info about a `https://developer.android.com/reference/android/view/Window.html`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#getOrCreate(android.content.Context)` | to get an instance. |

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#getOrCreate(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html)` Provide an instance of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker` that is associated to the given `https://developer.android.com/reference/android/content/Context.html`. |

| ### Public functions |
|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` | `@https://developer.android.com/reference/kotlin/androidx/window/RequiresWindowSdkExtension(version = 9) https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#getCurrentWindowLayoutInfo(android.content.Context)(context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html)` Returns the current `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` for the given `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#getCurrentWindowLayoutInfo(android.content.Context)`. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#registerWindowEngagementInfoListener(android.content.Context,java.util.concurrent.Executor,androidx.core.util.Consumer)( context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html, executor: https://developer.android.com/reference/java/util/concurrent/Executor.html, listener: https://developer.android.com/reference/kotlin/androidx/core/util/Consumer<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo> )` Registers a `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext` listener to consume `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo` values. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#registerWindowLayoutInfoListener(android.content.Context,java.util.concurrent.Executor,androidx.core.util.Consumer)( context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html, executor: https://developer.android.com/reference/java/util/concurrent/Executor.html, listener: https://developer.android.com/reference/kotlin/androidx/core/util/Consumer<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo> )` Registers a `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext` listener to consume `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` values. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#unregisterWindowEngagementInfoListener(androidx.core.util.Consumer)( listener: https://developer.android.com/reference/kotlin/androidx/core/util/Consumer<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo> )` Unregister a listener to stop consuming `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo` values. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#unregisterWindowLayoutInfoListener(androidx.core.util.Consumer)( listener: https://developer.android.com/reference/kotlin/androidx/core/util/Consumer<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo> )` Unregister a listener to stop consuming `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` values. |
| `open https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo>` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowEngagementInfo(android.content.Context)(context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html)` A `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo` that contains the current engagement modes. |
| `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo>` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.app.Activity)(activity: https://developer.android.com/reference/android/app/Activity.html)` A `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` that contains all the available features. |
| `open https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo>` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)(context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html)` A `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` that contains all the available features. |

| ### Public properties |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/window/layout/SupportedPosture>` | `@https://developer.android.com/reference/kotlin/androidx/window/RequiresWindowSdkExtension(version = 6) https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#supportedPostures()` Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of `https://developer.android.com/reference/kotlin/androidx/window/layout/SupportedPosture` values. |

| ### Extension functions |
|---|---|
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo>` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker.https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#(androidx.window.layout.WindowInfoTracker).windowLayoutInfoFlowable(android.app.Activity)(activity: https://developer.android.com/reference/android/app/Activity.html)` Return a `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo>` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker.https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#(androidx.window.layout.WindowInfoTracker).windowLayoutInfoFlowable(android.app.Activity)(activity: https://developer.android.com/reference/android/app/Activity.html)` Return a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`. |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo>` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker.https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#(androidx.window.layout.WindowInfoTracker).windowLayoutInfoFlowable(android.content.Context)(context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html)` Return a `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo>` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker.https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#(androidx.window.layout.WindowInfoTracker).windowLayoutInfoFlowable(android.content.Context)(context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html)` Return a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`. |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo>` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker.https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#(androidx.window.layout.WindowInfoTracker).windowLayoutInfoObservable(android.app.Activity)(activity: https://developer.android.com/reference/android/app/Activity.html)` Return an `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo>` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker.https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#(androidx.window.layout.WindowInfoTracker).windowLayoutInfoObservable(android.app.Activity)(activity: https://developer.android.com/reference/android/app/Activity.html)` Return an `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`. |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo>` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker.https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#(androidx.window.layout.WindowInfoTracker).windowLayoutInfoObservable(android.content.Context)( context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html )` Return an `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo>` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker.https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#(androidx.window.layout.WindowInfoTracker).windowLayoutInfoObservable(android.content.Context)( context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html )` Return an `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`. |

## Public companion functions

### getOrCreate

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/window#1.0.0)

```
fun getOrCreate(context: Context): WindowInfoTracker
```

Provide an instance of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker` that is associated to the given `https://developer.android.com/reference/android/content/Context.html`. The instance created should be safe to retain globally. The actual data is provided by `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` and requires an `https://developer.android.com/reference/android/app/Activity.html`.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | Any valid `https://developer.android.com/reference/android/content/Context.html`. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |

## Public functions

### getCurrentWindowLayoutInfo

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/window#1.5.0)

```
@RequiresWindowSdkExtension(version = 9)
open fun getCurrentWindowLayoutInfo(context: @UiContext Context): WindowLayoutInfo
```

Returns the current `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` for the given `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#getCurrentWindowLayoutInfo(android.content.Context)`.

This API provides a convenient way to access the current `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`. It can be used after the `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#getCurrentWindowLayoutInfo(android.content.Context)` associated window has been created, such as `https://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)`. Calling it before that will return an empty info.

For apps that need to update layout UI based on the `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`, it should also listen to `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` for any changes later.

| Parameters |
|---|---|
| `context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html` | a `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext` such as an `https://developer.android.com/reference/android/app/Activity.html`, an `https://developer.android.com/reference/android/inputmethodservice/InputMethodService.html`, or an instance created via `https://developer.android.com/reference/android/content/Context.html#createWindowContext(android.view.Display, int, android.os.Bundle)` that listens to configuration changes. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` | the current `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` for the given `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#getCurrentWindowLayoutInfo(android.content.Context)`. If the `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#getCurrentWindowLayoutInfo(android.content.Context)` is not associated with a window, returns an empty `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unsupported-operation-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/window/WindowSdkExtensions#extensionVersion()` is less than 9. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | when `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#getCurrentWindowLayoutInfo(android.content.Context)` is not an `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-not-implemented-error/index.html` | when this method has no supporting implementation. |

### registerWindowEngagementInfoListener

Added in [1.6.0-alpha05](https://developer.android.com/jetpack/androidx/releases/window#1.6.0-alpha05)

```
open fun registerWindowEngagementInfoListener(
    context: @UiContext Context,
    executor: Executor,
    listener: Consumer<WindowEngagementInfo>
): Unit
```

Registers a `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext` listener to consume `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo` values. If the same listener is registered twice then this method is a no-op.

This method can be long-running as it performs an initial check of all input devices. It is recommended to provide a background `https://developer.android.com/reference/java/util/concurrent/Executor.html` and call this method from a background coroutine context.

| Parameters |
|---|---|
| `context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html` | a `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext` such as an `https://developer.android.com/reference/android/app/Activity.html`. |
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | that the listener will invoke on. |
| `listener: https://developer.android.com/reference/kotlin/androidx/core/util/Consumer<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo>` | for `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo` values. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowEngagementInfo(android.content.Context)` |   |

### registerWindowLayoutInfoListener

Added in [1.6.0-alpha05](https://developer.android.com/jetpack/androidx/releases/window#1.6.0-alpha05)

```
open fun registerWindowLayoutInfoListener(
    context: @UiContext Context,
    executor: Executor,
    listener: Consumer<WindowLayoutInfo>
): Unit
```

Registers a `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext` listener to consume `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` values. If the same listener is registered twice then this method is a no-op.

| Parameters |
|---|---|
| `context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html` | a `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext` such as an `https://developer.android.com/reference/android/app/Activity.html`. |
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | that the listener will invoke on. |
| `listener: https://developer.android.com/reference/kotlin/androidx/core/util/Consumer<https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo>` | for `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` values. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |

### unregisterWindowEngagementInfoListener

Added in [1.6.0-alpha05](https://developer.android.com/jetpack/androidx/releases/window#1.6.0-alpha05)

```
open fun unregisterWindowEngagementInfoListener(
    listener: Consumer<WindowEngagementInfo>
): Unit
```

Unregister a listener to stop consuming `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo` values. If the listener has already been removed then this is a no-op.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowEngagementInfo(android.content.Context)` |   |

### unregisterWindowLayoutInfoListener

Added in [1.6.0-alpha05](https://developer.android.com/jetpack/androidx/releases/window#1.6.0-alpha05)

```
open fun unregisterWindowLayoutInfoListener(
    listener: Consumer<WindowLayoutInfo>
): Unit
```

Unregister a listener to stop consuming `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` values. If the listener has already been removed then this is a no-op.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |

### windowEngagementInfo

Added in [1.6.0-alpha05](https://developer.android.com/jetpack/androidx/releases/window#1.6.0-alpha05)

```
open fun windowEngagementInfo(context: @UiContext Context): Flow<WindowEngagementInfo>
```

A `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo` that contains the current engagement modes.

This method can be long-running as it performs an initial check of all input devices. It is recommended to collect this `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` on a background dispatcher.

| Parameters |
|---|---|
| `context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html` | a `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext` such as an `https://developer.android.com/reference/android/app/Activity.html` or a WindowContext. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowEngagementInfo` |   |

### windowLayoutInfo

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/window#1.0.0)

```
fun windowLayoutInfo(activity: Activity): Flow<WindowLayoutInfo>
```

A `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` that contains all the available features. A `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` contains a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of `https://developer.android.com/reference/kotlin/androidx/window/layout/DisplayFeature` that intersect the associated `https://developer.android.com/reference/android/view/Window.html`.

The first `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` will not be emitted until `https://developer.android.com/reference/android/app/Activity.html#onStart()` has been called. which values you receive and when is device dependent.

It is recommended to test the following scenarios since behaviors may differ between hardware implementations:

- Values are emitted immediately after subscribing to this function.

- There is a long delay between subscribing and receiving the first value.

- Never receiving a value after subscription.

Since the information is associated to the `https://developer.android.com/reference/android/app/Activity.html` you should not retain the `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` across `https://developer.android.com/reference/android/app/Activity.html` recreations. Doing so can result in unpredictable behavior such as a memory leak or incorrect values for `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`.

| Parameters |
|---|---|
| `activity: https://developer.android.com/reference/android/app/Activity.html` | an `https://developer.android.com/reference/android/app/Activity.html` that has not been destroyed. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` |   |
| `https://developer.android.com/reference/kotlin/androidx/window/layout/DisplayFeature` |   |

### windowLayoutInfo

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/window#1.1.0)

```
open fun windowLayoutInfo(context: @UiContext Context): Flow<WindowLayoutInfo>
```

A `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` that contains all the available features. A `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` contains a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of `https://developer.android.com/reference/kotlin/androidx/window/layout/DisplayFeature` that intersect the associated `https://developer.android.com/reference/android/view/Window.html`.

This method exports the same content as the `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` method that accepts an `https://developer.android.com/reference/android/app/Activity.html` as a parameter, but also supports non-Activity windows to receive `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` updates. A `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` value should be published when `https://developer.android.com/reference/kotlin/androidx/window/layout/DisplayFeature` have changed, but the behavior is ultimately decided by the hardware implementation. It is recommended to test the following scenarios:

- Values are emitted immediately after subscribing to this function.

- There is a long delay between subscribing and receiving the first value.

- Never receiving a value after subscription.

A derived class may throw NotImplementedError if this method is not overridden. Obtaining a `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker` through `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#getOrCreate(android.content.Context)` guarantees having a default implementation for this method.

If the passed `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` is not an `https://developer.android.com/reference/android/app/Activity.html` and `https://developer.android.com/reference/kotlin/androidx/window/WindowSdkExtensions#extensionVersion()` is less than 2, the flow will return empty `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` list flow.

| Parameters |
|---|---|
| `context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html` | a `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext` such as an `https://developer.android.com/reference/android/app/Activity.html`, an `https://developer.android.com/reference/android/inputmethodservice/InputMethodService.html`, or an instance created via `https://developer.android.com/reference/android/content/Context.html#createWindowContext(android.view.Display, int, android.os.Bundle)` that listens to configuration changes. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | when `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` is not an `https://developer.android.com/reference/kotlin/androidx/annotation/UiContext`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-not-implemented-error/index.html` | when this method has no supporting implementation. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo` |   |
| `https://developer.android.com/reference/kotlin/androidx/window/layout/DisplayFeature` |   |

## Public properties

### supportedPostures

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/window#1.4.0)

```
@RequiresWindowSdkExtension(version = 6)
open val supportedPostures: List<SupportedPosture>
```

Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of `https://developer.android.com/reference/kotlin/androidx/window/layout/SupportedPosture` values. This value will not change during runtime. These values are for determining if the device supports the given `https://developer.android.com/reference/kotlin/androidx/window/layout/SupportedPosture` but does not mean the device is in the given `https://developer.android.com/reference/kotlin/androidx/window/layout/SupportedPosture`. Use `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` to determine the current state of the `https://developer.android.com/reference/kotlin/androidx/window/layout/DisplayFeature`'s on the device.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unsupported-operation-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/window/WindowSdkExtensions#extensionVersion()` is less than 6. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-not-implemented-error/index.html` | if a derived test class does not override this method. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |

## Extension functions

### WindowInfoTracker.windowLayoutInfoFlowable

Artifact: [androidx.window:window-rxjava2](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/rxjava2/layout/WindowInfoTrackerRx.kt+function:windowLayoutInfoFlowable)

```
fun WindowInfoTracker.windowLayoutInfoFlowable(activity: Activity): Flowable<WindowLayoutInfo>
```

Return a `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |

### WindowInfoTracker.windowLayoutInfoFlowable

Artifact: [androidx.window:window-rxjava2](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/rxjava2/layout/WindowInfoTrackerRx.kt+function:windowLayoutInfoFlowable)

```
fun WindowInfoTracker.windowLayoutInfoFlowable(activity: Activity): Flowable<WindowLayoutInfo>
```

Return a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |

### WindowInfoTracker.windowLayoutInfoFlowable

Artifact: [androidx.window:window-rxjava2](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/rxjava2/layout/WindowInfoTrackerRx.kt+function:windowLayoutInfoFlowable)

```
fun WindowInfoTracker.windowLayoutInfoFlowable(context: @UiContext Context): Flowable<WindowLayoutInfo>
```

Return a `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |

### WindowInfoTracker.windowLayoutInfoFlowable

Artifact: [androidx.window:window-rxjava2](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/rxjava2/layout/WindowInfoTrackerRx.kt+function:windowLayoutInfoFlowable)

```
fun WindowInfoTracker.windowLayoutInfoFlowable(context: @UiContext Context): Flowable<WindowLayoutInfo>
```

Return a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |

### WindowInfoTracker.windowLayoutInfoObservable

Artifact: [androidx.window:window-rxjava2](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/rxjava2/layout/WindowInfoTrackerRx.kt+function:windowLayoutInfoObservable)

```
fun WindowInfoTracker.windowLayoutInfoObservable(activity: Activity): Observable<WindowLayoutInfo>
```

Return an `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |

### WindowInfoTracker.windowLayoutInfoObservable

Artifact: [androidx.window:window-rxjava2](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/rxjava2/layout/WindowInfoTrackerRx.kt+function:windowLayoutInfoObservable)

```
fun WindowInfoTracker.windowLayoutInfoObservable(activity: Activity): Observable<WindowLayoutInfo>
```

Return an `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |

### WindowInfoTracker.windowLayoutInfoObservable

Artifact: [androidx.window:window-rxjava2](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/rxjava2/layout/WindowInfoTrackerRx.kt+function:windowLayoutInfoObservable)

```
fun WindowInfoTracker.windowLayoutInfoObservable(
    context: @UiContext Context
): Observable<WindowLayoutInfo>
```

Return an `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |

### WindowInfoTracker.windowLayoutInfoObservable

Artifact: [androidx.window:window-rxjava2](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/rxjava2/layout/WindowInfoTrackerRx.kt+function:windowLayoutInfoObservable)

```
fun WindowInfoTracker.windowLayoutInfoObservable(
    context: @UiContext Context
): Observable<WindowLayoutInfo>
```

Return an `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` stream of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoTracker#windowLayoutInfo(android.content.Context)` |   |