# 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)

*** ** * ** ***


```
public abstract class WindowInfoController
```

<br />

*** ** * ** ***

An interface to interact with Window properties and layout.

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/layout/WindowInfoController` | `https://developer.android.com/reference/androidx/window/layout/WindowInfoController#getInstance(android.content.Context)(@https://developer.android.com/reference/androidx/annotation/UiContext @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context)` Gets an instance of `https://developer.android.com/reference/androidx/window/layout/WindowInfoController` for the given `https://developer.android.com/reference/android/content/Context.html`. |
| `abstract void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/window/layout/WindowInfoController#requestVisualState(android.content.Context,androidx.window.layout.VisualStateRequest)( @https://developer.android.com/reference/androidx/annotation/UiContext @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/layout/VisualStateRequest request )` Dispatches a request to modify the visual state of the window. |

## Public methods

### getInstance

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

```
public static final @NonNull WindowInfoController getInstance(@UiContext @NonNull Context context)
```

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

### requestVisualState

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

```
@MainThread
public abstract void requestVisualState(
    @UiContext @NonNull Context context,
    @NonNull VisualStateRequest request
)
```

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/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/UiContext @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context` | The `https://developer.android.com/reference/android/content/Context.html` used to dispatch the request. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/layout/VisualStateRequest request` | The `https://developer.android.com/reference/androidx/window/layout/VisualStateRequest` containing the desired visual state. |