Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/view/WindowInsets.Type#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/view/WindowInsets.Type#inhmethods)

# WindowInsets.Type

*** ** * ** ***


`
public
static
final

class
WindowInsets.Type
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.WindowInsets.Type |

<br />

*** ** * ** ***

Class that defines different types of sources causing window insets.

Each type is represented by an integer bit flag. Types can be combined using bitwise OR
(e.g. `Type.statusBars() | Type.navigationBars()`) and passed to query methods such as
`https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)`, `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)`,
`https://developer.android.com/reference/android/view/WindowInsets#isVisible(int)`, `https://developer.android.com/reference/android/view/WindowInsets#getBoundingRects(int)`, or to
`https://developer.android.com/reference/android/view/WindowInsetsController` methods to request showing or hiding system elements.

<br />

## Summary

| ### Public methods ||
|---|---|
| ` static int` | ` https://developer.android.com/reference/android/view/WindowInsets.Type#captionBar()() ` Returns an insets type representing the window of a caption bar. |
| ` static int` | ` https://developer.android.com/reference/android/view/WindowInsets.Type#displayCutout()() ` Returns an insets type representing the area that used by `https://developer.android.com/reference/android/view/DisplayCutout`. |
| ` static int` | ` https://developer.android.com/reference/android/view/WindowInsets.Type#ime()() ` Returns an insets type representing the window of an on-screen Input Method Editor (IME). |
| ` static int` | ` https://developer.android.com/reference/android/view/WindowInsets.Type#mandatorySystemGestures()() ` Returns an insets type representing the mandatory system gesture insets. |
| ` static int` | ` https://developer.android.com/reference/android/view/WindowInsets.Type#navigationBars()() ` Returns an insets type representing any system bars for navigation. |
| ` static int` | ` https://developer.android.com/reference/android/view/WindowInsets.Type#statusBars()() ` Returns an insets type representing any system bars displaying device status. |
| ` static int` | ` https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()() ` Returns an aggregate insets type representing all system bars and persistent system decorations. |
| ` static int` | ` https://developer.android.com/reference/android/view/WindowInsets.Type#systemGestures()() ` Returns an insets type representing the system gesture insets. |
| ` static int` | ` https://developer.android.com/reference/android/view/WindowInsets.Type#systemOverlays()() ` Returns an insets type representing persistent, non-dismissible system overlays. |
| ` static int` | ` https://developer.android.com/reference/android/view/WindowInsets.Type#tappableElement()() ` Returns an insets type representing the tappable element insets. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Public methods

### captionBar

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int captionBar ()
```

Returns an insets type representing the window of a caption bar.

A caption bar represents the window header / title bar provided by the system for
window decorations and management controls (such as minimize, maximize/restore, close,
and title text).

Applications targeting desktop environments can use this inset alongside
`https://developer.android.com/reference/android/view/WindowInsets#getBoundingRects(int)` to draw custom header content without
colliding with system window control buttons.

<br />

| Returns ||
|---|---|
| `int` | An insets type representing the window of a caption bar. Value is either `0` or a combination of the following: |

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()`
- `https://developer.android.com/reference/android/view/WindowInsets#getBoundingRects(int)`

### displayCutout

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int displayCutout ()
```

Returns an insets type representing the area that used by `https://developer.android.com/reference/android/view/DisplayCutout`.

This is equivalent to the safe insets on `https://developer.android.com/reference/android/view/WindowInsets#getDisplayCutout()`.

Note: During dispatch to `https://developer.android.com/reference/android/view/View#onApplyWindowInsets(android.view.WindowInsets)`, if the window is using
the `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT`
`https://developer.android.com/reference/android/view/WindowManager.LayoutParams#layoutInDisplayCutoutMode`, `https://developer.android.com/reference/android/view/WindowInsets#getDisplayCutout()`
will return `null` even if the window overlaps a display cutout area, in which case
the `https://developer.android.com/reference/android/view/WindowInsets.Type#displayCutout()` will still report the accurate value.

<br />

| Returns ||
|---|---|
| `int` | Value is either `0` or a combination of the following: |

**See also:**

- `https://developer.android.com/reference/android/view/DisplayCutout#getSafeInsetLeft()`
- `https://developer.android.com/reference/android/view/DisplayCutout#getSafeInsetTop()`
- `https://developer.android.com/reference/android/view/DisplayCutout#getSafeInsetRight()`
- `https://developer.android.com/reference/android/view/DisplayCutout#getSafeInsetBottom()`

### ime

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int ime ()
```

Returns an insets type representing the window of an on-screen Input Method Editor (IME).

The IME inset represents the area occupied by the on-screen software keyboard when
requested by an active text input field.

**Floating \& Undocked IMEs:** When the on-screen keyboard is configured in floating
or undocked mode (such as on tablets, foldables, desktop environments, or when selected
by the user), it floats above window content without docking to a screen edge. In
floating mode, the keyboard does not produce window insets, and querying `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `ime()` will return `https://developer.android.com/reference/android/graphics/Insets#NONE` (even
while the keyboard is visible). Applications should note that floating keyboards may
occlude underlying UI elements without causing the view hierarchy to inset or resize.

**Note:** `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` cannot be queried
for `ime()` because the height of the IME is determined dynamically by the focused
view's `https://developer.android.com/reference/android/view/inputmethod/EditorInfo` and the IME state; attempting to do so will throw an `https://developer.android.com/reference/java/lang/IllegalArgumentException`.

<br />

| Returns ||
|---|---|
| `int` | Value is either `0` or a combination of the following: |

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsetsController#show(int)`
- `https://developer.android.com/reference/android/view/WindowInsetsController#hide(int)`
- `https://developer.android.com/reference/android/view/WindowInsetsAnimation.Callback`

### mandatorySystemGestures

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int mandatorySystemGestures ()
```

Returns an insets type representing the mandatory system gesture insets.

Mandatory system gesture insets represent the areas of a window where system gestures
are critical and **cannot** be overridden or opted out of by the application using
`https://developer.android.com/reference/android/view/View#setSystemGestureExclusionRects(java.util.List<android.graphics.Rect>)`.

<br />

| Returns ||
|---|---|
| `int` | Value is either `0` or a combination of the following: |

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets.Type#systemGestures()`
- `https://developer.android.com/reference/android/view/View#setSystemGestureExclusionRects(java.util.List<android.graphics.Rect>)`

### navigationBars

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int navigationBars ()
```

Returns an insets type representing any system bars for navigation.

Navigation bars provide affordances for the user to navigate to other screens or
activities.

These insets can be controlled dynamically via `https://developer.android.com/reference/android/view/WindowInsetsController`
APIs.

<br />

| Returns ||
|---|---|
| `int` | Value is either `0` or a combination of the following: |

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()`
- `https://developer.android.com/reference/android/view/WindowInsetsController#show(int)`
- `https://developer.android.com/reference/android/view/WindowInsetsController#hide(int)`
- `https://developer.android.com/reference/android/view/WindowInsetsController#controlWindowInsetsAnimation(int,%20long,%20android.view.animation.Interpolator,%20android.os.CancellationSignal,%20android.view.WindowInsetsAnimationControlListener)`

### statusBars

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int statusBars ()
```

Returns an insets type representing any system bars displaying device status.

Status bars typically display persistent indicators such as the clock, battery level,
signal strength, and notification icons.

This type of insets can be controlled dynamically via `https://developer.android.com/reference/android/view/WindowInsetsController`
APIs.

<br />

| Returns ||
|---|---|
| `int` | Value is either `0` or a combination of the following: |

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()`
- `https://developer.android.com/reference/android/view/WindowInsetsController#show(int)`
- `https://developer.android.com/reference/android/view/WindowInsetsController#hide(int)`
- `https://developer.android.com/reference/android/view/WindowInsetsController#controlWindowInsetsAnimation(int,%20long,%20android.view.animation.Interpolator,%20android.os.CancellationSignal,%20android.view.WindowInsetsAnimationControlListener)`

### systemBars

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int systemBars ()
```

Returns an aggregate insets type representing all system bars and persistent system
decorations.

Includes `https://developer.android.com/reference/android/view/WindowInsets.Type#statusBars()`, `https://developer.android.com/reference/android/view/WindowInsets.Type#navigationBars()`, `https://developer.android.com/reference/android/view/WindowInsets.Type#captionBar()`, and
`https://developer.android.com/reference/android/view/WindowInsets.Type#systemOverlays()`, but excludes `https://developer.android.com/reference/android/view/WindowInsets.Type#ime()` and `https://developer.android.com/reference/android/view/WindowInsets.Type#displayCutout()`.

<br />

| Returns ||
|---|---|
| `int` | Value is either `0` or a combination of the following: |

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets.Type#statusBars()`
- `https://developer.android.com/reference/android/view/WindowInsets.Type#navigationBars()`
- `https://developer.android.com/reference/android/view/WindowInsets.Type#captionBar()`
- `https://developer.android.com/reference/android/view/WindowInsets.Type#systemOverlays()`

### systemGestures

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int systemGestures ()
```

Returns an insets type representing the system gesture insets.

The system gesture insets represent the area of a window where system gestures (such
as the edge-swipe back gesture or bottom-swipe home gesture) have priority and may
consume touch input before it reaches the window.

Simple taps are guaranteed to reach the window even within the system gesture insets,
as long as they are outside the areas reported by `https://developer.android.com/reference/android/view/WindowInsets#getSystemWindowInsets()`.

Apps can declare priority over non-mandatory system gestures in specific sub-regions
using `https://developer.android.com/reference/android/view/View#setSystemGestureExclusionRects(java.util.List<android.graphics.Rect>)`.

<br />

| Returns ||
|---|---|
| `int` | Value is either `0` or a combination of the following: |

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets.Type#mandatorySystemGestures()`
- `https://developer.android.com/reference/android/view/View#setSystemGestureExclusionRects(java.util.List<android.graphics.Rect>)`
- `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)`

### systemOverlays

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int systemOverlays ()
```

Returns an insets type representing persistent, non-dismissible system overlays.

System overlays represent insets caused by system-provided UI elements overlaid on the
screen or window that cannot be hidden or controlled by client `https://developer.android.com/reference/android/view/WindowInsetsController` requests.

For compatibility reasons, this type is included in `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()`, ensuring
views that fit `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` automatically accommodate system overlays.

<br />

| Returns ||
|---|---|
| `int` | Value is either `0` or a combination of the following: |

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()`

### tappableElement

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int tappableElement ()
```

Returns an insets type representing the tappable element insets.

Apps should inset its tappable elements by at least this amount to ensure they can be
tapped.

This inset is always at most the size of `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()`. It may be smaller than
the `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` inset if the system bars let through clean taps but not other
kinds of gestures.

<br />

| Returns ||
|---|---|
| `int` | Value is either `0` or a combination of the following: |