The Developer Preview for Android 11 is now available; test it out and share your feedback.

WindowInsets.Type

public static final class WindowInsets.Type
extends Object

java.lang.Object
   ↳ android.view.WindowInsets.Type


Class that defines different types of sources causing window insets.

Summary

Public methods

static int all()
static int captionBar()
static int ime()
static int mandatorySystemGestures()
static int navigationBars()
static int statusBars()
static int systemBars()
static int systemGestures()

Returns an insets type representing the system gesture insets.

static int tappableElement()
static int windowDecor()

Inherited methods

Public methods

all

public static int all ()

Returns
int All inset types combined. TODO: Figure out if this makes sense at all, mixing e.g systemGestures() and ime() does not seem very useful. Value is either 0 or a combination of android.view.WindowInsets.Type.STATUS_BARS, android.view.WindowInsets.Type.NAVIGATION_BARS, android.view.WindowInsets.Type.CAPTION_BAR, android.view.WindowInsets.Type.IME, android.view.WindowInsets.Type.WINDOW_DECOR, android.view.WindowInsets.Type.SYSTEM_GESTURES, android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES, and android.view.WindowInsets.Type.TAPPABLE_ELEMENT

captionBar

public static int captionBar ()

Returns
int An insets type representing the window of a caption bar. Value is either 0 or a combination of android.view.WindowInsets.Type.STATUS_BARS, android.view.WindowInsets.Type.NAVIGATION_BARS, android.view.WindowInsets.Type.CAPTION_BAR, android.view.WindowInsets.Type.IME, android.view.WindowInsets.Type.WINDOW_DECOR, android.view.WindowInsets.Type.SYSTEM_GESTURES, android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES, and android.view.WindowInsets.Type.TAPPABLE_ELEMENT

ime

public static int ime ()

Returns
int An insets type representing the window of an InputMethod. Value is either 0 or a combination of android.view.WindowInsets.Type.STATUS_BARS, android.view.WindowInsets.Type.NAVIGATION_BARS, android.view.WindowInsets.Type.CAPTION_BAR, android.view.WindowInsets.Type.IME, android.view.WindowInsets.Type.WINDOW_DECOR, android.view.WindowInsets.Type.SYSTEM_GESTURES, android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES, and android.view.WindowInsets.Type.TAPPABLE_ELEMENT

mandatorySystemGestures

public static int mandatorySystemGestures ()

Returns
int Value is either 0 or a combination of android.view.WindowInsets.Type.STATUS_BARS, android.view.WindowInsets.Type.NAVIGATION_BARS, android.view.WindowInsets.Type.CAPTION_BAR, android.view.WindowInsets.Type.IME, android.view.WindowInsets.Type.WINDOW_DECOR, android.view.WindowInsets.Type.SYSTEM_GESTURES, android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES, and android.view.WindowInsets.Type.TAPPABLE_ELEMENT

public static int navigationBars ()

Returns
int An insets type representing any system bars for navigation. Value is either 0 or a combination of android.view.WindowInsets.Type.STATUS_BARS, android.view.WindowInsets.Type.NAVIGATION_BARS, android.view.WindowInsets.Type.CAPTION_BAR, android.view.WindowInsets.Type.IME, android.view.WindowInsets.Type.WINDOW_DECOR, android.view.WindowInsets.Type.SYSTEM_GESTURES, android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES, and android.view.WindowInsets.Type.TAPPABLE_ELEMENT

statusBars

public static int statusBars ()

Returns
int An insets type representing any system bars for displaying status. Value is either 0 or a combination of android.view.WindowInsets.Type.STATUS_BARS, android.view.WindowInsets.Type.NAVIGATION_BARS, android.view.WindowInsets.Type.CAPTION_BAR, android.view.WindowInsets.Type.IME, android.view.WindowInsets.Type.WINDOW_DECOR, android.view.WindowInsets.Type.SYSTEM_GESTURES, android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES, and android.view.WindowInsets.Type.TAPPABLE_ELEMENT

systemBars

public static int systemBars ()

Returns
int All system bars. Includes statusBars() as well as navigationBars(), but not ime(). Value is either 0 or a combination of android.view.WindowInsets.Type.STATUS_BARS, android.view.WindowInsets.Type.NAVIGATION_BARS, android.view.WindowInsets.Type.CAPTION_BAR, android.view.WindowInsets.Type.IME, android.view.WindowInsets.Type.WINDOW_DECOR, android.view.WindowInsets.Type.SYSTEM_GESTURES, android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES, and android.view.WindowInsets.Type.TAPPABLE_ELEMENT

systemGestures

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 have priority and may consume some or all touch input, e.g. due to the a system bar occupying it, or it being reserved for touch-only gestures.

Simple taps are guaranteed to reach the window even within the system gesture insets, as long as they are outside the system window insets.

When View#SYSTEM_UI_FLAG_LAYOUT_STABLE is requested, an inset will be returned even when the system gestures are inactive due to View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION.

Returns
int Value is either 0 or a combination of android.view.WindowInsets.Type.STATUS_BARS, android.view.WindowInsets.Type.NAVIGATION_BARS, android.view.WindowInsets.Type.CAPTION_BAR, android.view.WindowInsets.Type.IME, android.view.WindowInsets.Type.WINDOW_DECOR, android.view.WindowInsets.Type.SYSTEM_GESTURES, android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES, and android.view.WindowInsets.Type.TAPPABLE_ELEMENT

tappableElement

public static int tappableElement ()

Returns
int Value is either 0 or a combination of android.view.WindowInsets.Type.STATUS_BARS, android.view.WindowInsets.Type.NAVIGATION_BARS, android.view.WindowInsets.Type.CAPTION_BAR, android.view.WindowInsets.Type.IME, android.view.WindowInsets.Type.WINDOW_DECOR, android.view.WindowInsets.Type.SYSTEM_GESTURES, android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES, and android.view.WindowInsets.Type.TAPPABLE_ELEMENT

windowDecor

public static int windowDecor ()

Returns
int An insets type representing decor that is being app-controlled. Value is either 0 or a combination of android.view.WindowInsets.Type.STATUS_BARS, android.view.WindowInsets.Type.NAVIGATION_BARS, android.view.WindowInsets.Type.CAPTION_BAR, android.view.WindowInsets.Type.IME, android.view.WindowInsets.Type.WINDOW_DECOR, android.view.WindowInsets.Type.SYSTEM_GESTURES, android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES, and android.view.WindowInsets.Type.TAPPABLE_ELEMENT