WindowInfoRepo

interface WindowInfoRepo

Known direct subclasses
WindowInfoRepoJavaAdapter

A Java compatible interface of WindowInfoRepo.


An interface to provide all the relevant info about a android.view.Window.

Summary

Public fields

abstract @NonNull WindowMetrics

Returns the WindowMetrics according to the current system state.

abstract @NonNull WindowMetrics

Returns the largest WindowMetrics an app may expect in the current system state.

abstract @NonNull Flow<@NonNull WindowLayoutInfo>

A Flow of WindowLayoutInfo that contains all the available features.

Public fields

currentWindowMetrics

@NonNull
public abstract @NonNull WindowMetrics currentWindowMetrics

Returns the WindowMetrics according to the current system state.

The metrics describe the size of the area the window would occupy with MATCH_PARENT width and height and any combination of flags that would allow the window to extend behind display cutouts.

The value of this is based on the current windowing state of the system. For example, for activities in multi-window mode, the metrics returned are based on the current bounds that the user has selected for the Activity's window.

maximumWindowMetrics

@NonNull
public abstract @NonNull WindowMetrics maximumWindowMetrics

Returns the largest WindowMetrics an app may expect in the current system state.

The metrics describe the size of the largest potential area the window might occupy with MATCH_PARENT width and height and any combination of flags that would allow the window to extend behind display cutouts.

The value of this is based on the largest potential windowing state of the system. For example, for activities in multi-window mode the metrics returned are based on what the bounds would be if the user expanded the window to cover the entire screen.

Note that this might still be smaller than the size of the physical display if certain areas of the display are not available to windows created for the associated Context. For example, devices with foldable displays that wrap around the enclosure may split the physical display into different regions, one for the front and one for the back, each acting as different logical displays. In this case maximumWindowMetrics would return the region describing the side of the device the associated context's window is placed.

windowLayoutInfo

@NonNull
public abstract @NonNull Flow<@NonNull WindowLayoutInfowindowLayoutInfo

A Flow of WindowLayoutInfo that contains all the available features.