# WindowInfoController

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

*** ** * ** ***


```
abstract class WindowInfoController
```

<br />

*** ** * ** ***

An interface to interact with Window properties and layout.

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoController` | `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoController#getInstance(android.content.Context)(context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html)` Gets an instance of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoController` for the given `https://developer.android.com/reference/android/content/Context.html`. |

| ### Public functions |
|---|---|
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoController#requestVisualState(android.content.Context,androidx.window.layout.VisualStateRequest)( context: @https://developer.android.com/reference/kotlin/androidx/annotation/UiContext https://developer.android.com/reference/android/content/Context.html, request: https://developer.android.com/reference/kotlin/androidx/window/layout/VisualStateRequest )` Dispatches a request to modify the visual state of the window. |

## Public companion functions

### getInstance

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

```
fun getInstance(context: @UiContext Context): WindowInfoController
```

Gets an instance of `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowInfoController` for the given `https://developer.android.com/reference/android/content/Context.html`.

## Public functions

### requestVisualState

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

```
@MainThread
abstract fun requestVisualState(
    context: @UiContext Context,
    request: VisualStateRequest
): Unit
```

Dispatches a request to modify the visual state of the window.

The requested state is evaluated against the task hierarchy by the system. It is automatically cleared when the requesting task is no longer active.

Note that this is a request; it is up to the system to determine whether the requested visual state will be respected based on device policies and hardware capabilities. Applications should observe `https://developer.android.com/reference/kotlin/androidx/window/layout/WindowLayoutInfo#engagementModes()` to observe the actual applied state.

Note: Throws `IllegalStateException` if not called on the main thread, or if the provided context is not a UI context (e.g. an Application context).

On Android 16 (API level 37) and above, this request is forwarded to the system. On lower API levels, calling 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` | The `https://developer.android.com/reference/android/content/Context.html` used to dispatch the request. |
| `request: https://developer.android.com/reference/kotlin/androidx/window/layout/VisualStateRequest` | The `https://developer.android.com/reference/kotlin/androidx/window/layout/VisualStateRequest` containing the desired visual state. |